ubuntu 下 mysql 开启远程连接
程序员文章站
2022-05-28 08:31:31
...
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 [email protected]'%' identified by '密码';
数据库名和表名同时为*的时候表示可以访问所有数据库
上一篇: SAX解析XML