Ubuntu Server 下开启远程连接 MySQL
2010-11-25 09:24
609 查看
通过远程连接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 了
第一步是要创建一个可以远程连接的 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 了
相关文章推荐
- 云服务器Ubuntu_Server_16.04.1安装MySQL并开启远程连接的方法
- Ubuntu16.04 server下配置MySQL,并开启远程连接的方法
- Ubuntu Server 下开启远程连接MySQL
- Ubuntu Server 下开启远程连接 MySQL
- Ubuntu16.04 server下配置MySQL,并开启远程连接
- ubuntu mysql 安装----修改密码----开启远程连接
- ubuntu下mysql 开启远程连接
- aws linux服务器,ubuntu,远程连接MySQL,ERROR 2003 (HY000): Can't connect to MySQL server on
- mysql连接权限问题 Host 'XXX' is not allowed to connect to this MySQL server 解决方案/如何开启MySQL的远程帐号
- Ubuntu16.04服务器安装配置MySQL并开启远程连接
- Ubuntu 下开启远程连接 MySQL
- ubuntu server配置mysql并实现远程连接的操作方法
- Ubuntu系统下MySQL开启远程连接
- ubuntu-server-15.10 mysql 远程连接
- 远程连接Ubuntu下的MySQL详解 – Can't connect to MySQL server on '88.88.88.88'(10061)
- ubuntu 中的mysql server 无法远程连接
- Ubuntu Server 中MySQL无法远程连接?
- 【MySQL错误系列】本地无法远程连接阿里云Ubuntu环境下Mysql数据库cant connect to mysql server on …..(10061)
- Ubuntu下安装MySQL,开启MySQL远程连接权限
- 简单介绍ubuntu server与desktop关系以及解决ubuntu server下的mysql无法被远程连接