Ubuntu Server 下打开远程连接MySQL

发布时间:2019-08-03  栏目:LINUX  评论:0 Comments

manbet手机客户端3.0,Ubuntu Server
下展开远程连接MySQL,需求做两步:

首先步是要开创多个能够远程连接的 MySQL 用户

mysql> GRANT ALL PRIVILEGES ON remote.* TO remote@”%” IDENTIFIED BY
“remotepwd”;

其次步是要修改 mysql 的配备文件 /etc/mysql/my.cnf

$> sudo vi /etc/mysql/my.cnf

在旧版本中找到 skip-networking,把它注释掉就足以了
#skip-networking

在新本子中:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address           = 127.0.0.1

bind-address           = 127.0.0.1 这一行要疏解掉
#bind-address           = 127.0.0.1

依旧把允许访问的 ip 填上
#bind-address       = 192.168.1.100

接下来重启 MySQL
$> sudo /etc/init.d/mysql restart
* Starting MySQL database server mysqld
   …done.
* Checking for corrupt, not cleanly closed and upgrade needing
tables.
andy@ubuntu:~$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld
   …done.

这样就足以中距离访谈 MySQL 了

manbet手机客户端3.0 1

留下评论

网站地图xml地图