Home > Database > Mysql Tutorial > Ubuntu下让MySQL数据库能被远程访问

Ubuntu下让MySQL数据库能被远程访问

WBOY
Release: 2016-06-07 16:51:07
Original
946 people have browsed it

在Ubuntu下MySQL缺省是只允许本地访问的,如果你要其他机器也能远程够访问这台Mysql数据库的话,需要设置一些东西,下面我们一步

在Ubuntu下MySQL缺省是只允许本地访问的,如果你要其他机器也能远程够访问这台Mysql数据库的话,需要设置一些东西,下面我们一步步地来:

一、配置文件的修改

1.#sudo vim /etc/mysql/my.conf

找到 bind-address = 127.0.0.1

注释掉这句话

二、Mysql数据库的修改

1) [root@etc etc]# mysql -u  root  -p

Enter password:

2)mysql> use mysql;

3)mysql> select host,user,password from user;

4)grant all privileges on *.* to  root@192.168.15.101  identified by 'password'

注意: (1)192.168.15.101是欲连接到此Mysql数据库的客户端的IP地址,而不是Mysql数据库所在数据库服务器的IP地址,,切记

(2)password就是Mysql数据库root用户的password,根据实际情况需要修改

三、再次用Mysql客户端登陆

linux

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