VIM常用命令
ssh远程连接服务器失败

Debian下配置MySQL远程访问

Summer Flower posted @ 2011年1月10日 06:02 in linux , 1133 阅读

1.修改/etc/mysql/my.conf文件,将bind-address绑定到MySQL服务器的实际IP地址:

[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 192.168.18.104

2.使用root登录mysql执行如下命令:

 

grant all on test.* to user@'%' identified by 'password';
grant all on test.* to user@localhost identified by 'password';

其中test为你要远程访问的数据库,user是你使用的用户名,password为该用户的密码。


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter