日期:2014-05-16  浏览次数:20824 次

ubuntu 下 mysql 开启远程连接

1.修改/etc/mysql/my.conf,修改bind-address,指定为本机实际ip地址,你的my.con修改完大概是如下的样子

 [mysqld]

#
# * basic settings
#
default-character-set=utf8
default-storage-engine=innodb
bind-address = 192.168.1.100
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

?2.用root登陆mysql执行如下命令

grant all on 数据库名.表名 to root@'%' identified by '密码';

?数据库名和表名同时为*的时候表示可以访问所有数据库

?

?