远程链接mysql
1、创建一个新用户
GRANT ALL on *.* to 'username' identified by "xuys1234";
2 修改配置
sudo vim /etc/mysql/my.cnf
bind-address = 127.0.0.1 这一行要注释
3 重启mysql
sudo /etc/init.d/mysql restart
如果需要改密码,通过下面的语句
UPDATE user SET password=PASSWORD("new password") WHERE user='name'; FLUSH PRIVILEGES;
GRANT ALL on *.* to 'username' identified by "xuys1234";
2 修改配置
sudo vim /etc/mysql/my.cnf
bind-address = 127.0.0.1 这一行要注释
3 重启mysql
sudo /etc/init.d/mysql restart
如果需要改密码,通过下面的语句
UPDATE user SET password=PASSWORD("new password") WHERE user='name'; FLUSH PRIVILEGES;