Home >Database >Mysql Tutorial >Linux下配置Mysql允许远程访问详解_MySQL

Linux下配置Mysql允许远程访问详解_MySQL

WBOY
WBOYOriginal
2016-06-01 13:01:041190browse

操作非常简单,就5步骤,如下:

1.进入 mysql:

/usr/local/mysql/bin/mysql -u root -p

2.使用 mysql库 :

use mysql;

3.查看用户表 :

SELECT `Host`,`User` FROM user;

4.更新用户表 :

UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;

5.强制刷新权限 :

flush privileges;

完成以上步骤即可远程连接数据库了,上边关键的一句是

UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;
其中%的意思是允许所有的ip远程访问,如果需要指定具体的某个ip就写上具体的ip即可

KO...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn