mysql怎么设置远程连接数据库
2017-06-01
相关话题
在默认安装情况的mysql的数据库,远程客户端是无法进行连接另外一台的数据库,需要进行连接数据库的话,需要进行对mysql数据库进行设置之后,远程客户端才能连接数据库的。下面是小编跟大家分享的是mysql怎么设置远程连接数据库,欢迎大家来阅读学习~
mysql怎么设置远程连接数据库
工具/原料
mysql
方法/步骤
进入到了Linux的中界面中,需要进入到了数据库中,在命令行中输入mysql -u root -p 回车之后,进行输入数据的密码。

在进入到一个mysql的数据库中,进行use nysql

然后在命令中输入:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;

执行完成之后还需要输入flush privileges;就是立即生效

然后查看是否修改成功,进行输入select host,user from user;即可

如果还是不能连接进行重启Linux下。
