修改 /etc/mysql/my.cnf
#bind-address = 127.0.0.1
本地登录
mysql -u root -p
grant all on *.* to root identified by ‘123456;
/etc/init.d/mysql restart
ubuntu MySQL安装和设置
原文:http://www.cnblogs.com/ahuo/p/5304822.html