1.安装
sudo apt-get install mysql-server
2.修改 mysql 的配置文件 /etc/mysql/my.cnf
$> sudo vi /etc/mysql/my.cnf
在旧版本(MySQL5.0)中找到 skip-networking,把它注释掉就可以了
#skip-networking
在新版本中:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
把这一行要注释掉
#bind-address = 127.0.0.1
或者把允许访问的 ip 填上
#bind-address = 192.168.1.100
3.重启MYSQL
$> sudo /etc/init.d/mysql restart