Blogger Information
Blog 175
fans 1
comment 0
visits 384782
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
本地Navicat连不上Linux虚拟机MySQL数据库问题
dxp2tq的博客
Original
1317 people have browsed it

在Linux登录到MySQL数据:mysql -uroot -p
输入密码
切换到mysql数据库
   mysql>use mysql
输入grant all privileges on *.* to root@"%" identified by "密码";
mysql> grant all privileges on *.* to root@"%" identified by "563412";
这表示是给本地ip赋予了所有的权限,包括远程访问权限,%百分号表示允许任ip访问数据库。
然后再输入
mysql> flush privileges;
重新加载,,并退出
mysql>exit
然后,重启数据库
service mysqld restart 注:重启服务的命令有的是service,有的是systemctl,我不知道是Linux版本不一样,还是针对不同的服务,命令也不一样,这个注意一下
防火墙也要关了,service iptables stop 或者 systemctl stop firewalld.service
然后就可以了啦

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post