Home > Database > Mysql Tutorial > Ubuntu MySQL使用配置

Ubuntu MySQL使用配置

WBOY
Release: 2016-06-07 17:02:42
Original
877 people have browsed it

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

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

一、配置文件的修改
1.#sudo vim /etc/mysql/my.conf

找到 bind-address = 127.0.0.1
注释掉这句话

二、Mysql数据库的修改

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

Enter password:

2)mysql> usemysql;

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

4)grant allprivileges 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

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