Home > Database > Mysql Tutorial > 配置mysql允许远程连接的方法_MySQL

配置mysql允许远程连接的方法_MySQL

WBOY
Release: 2016-06-01 13:23:50
Original
1154 people have browsed it

bitsCN.com

vim /etc/my.cnf
注释这一行:bind-address=127.0.0.1 ==> #bind-address=127.0.0.1
保存退出。
mysql -uroot -p123456

为需要远程登录的用户赋予权限:

mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";
mysql> flush privileges;

远程登录命令:
mysql -h 223.4.92.130 -uroot -p(-h后跟的是要登录主机的ip地址)

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