简单配置
mysql_secure_installation
Enter current password for root (enter for none):<- 初次运行直接回车
Set root password? [Y/n] <- 是否设置 root 用户密码, 输入 y 并回车或直接回车
New password: <- 设置 root 用户的密码
Re-enter new password: <- 再输入一次你设置的密码
Remove anonymous users? [Y/n] <- 是否删除匿名用户, 回车
Disallow root login remotely? [Y/n] <- 是否禁止 root 远程登录, 回车,
Remove test database and access to it? [Y/n] <- 是否删除 test 数据库, 回车
Reload privilege tables now? [Y/n] <- 是否重新加载权限表, 回车
root 用户支持远程访问
- grant all privileges on *.* to '用户名'@'%' identified by '密码' with grant option;
- flush privileges;
来源: http://www.bubuko.com/infodetail-3377112.html