Home > Database > Mysql Tutorial > mysql解决远程不能访问的二种方法_MySQL

mysql解决远程不能访问的二种方法_MySQL

WBOY
Release: 2016-06-01 13:24:08
Original
1039 people have browsed it

bitsCN.com

1、在/etc/mysql/my.cnf中的[mysqld]段注释掉bind-address = 127.0.0.1

2、用mysql -uroot -p 登陆mysql,然后采用以下方法开启远程访问权限:

方法1:mysql>use mysql;
     mysql>update user set host = '%' where user = 'root';

    mysql>FLUSH RIVILEGES;

方法2:mysql>GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template