Blogger Information
Blog 41
fans 0
comment 1
visits 40354
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
如何用SQLyog、Navicat for MySQL实现远程连接MySQL
yeyiluLAMP
Original
1343 people have browsed it

经常会出现使用Nativat for MySQL 、SQLyog等MySQL数据库图形化管理工具,用root用户远程链接MySQL时,提示“访问被拒绝“问题

根本原因:MySQL默认不支持远程管理数据库,需要我们自行开启MySQL支持远程链接数据库

Linux(CentOS):

实现远程连接(授权法)

 
将host字段的值改为%就表示在任何客户端机器上能以root用户登录到mysql服务器,建议在开发时设为%
 

  将权限改为ALL PRIVILEGES

mysql> use mysql;
Database changed
mysql> grant all privileges on *.* to root@'%' identified by "root";
Query OK, 0 rows affected (0.00 sec)
mysql>  flush privileges;
Query OK, 0 rows affected (0.00 sec)


这样机器就可以以用户名root密码root远程访问该服务器上的MySQL

Ubuntu下则需要注意:

安装的MySQL中需要设置两步,centos源码安装请略过......

修改MySQL配置文件

vim /etc/mysql/msyql.confd/mysqld.cnf

修改前

bind-address = 127.0.0.1

修改后

bind-address = 0.0.0.0

重启MySQL即可

service mysql restart


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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!