- 论坛徽章:
- 0
|
linux 下mysql远程登录的实现,首先要先修改配置文件:
sudo vi /etc/mysql/my.cnf
然后找到
# using "localhost" in connects uses sockets by default
# skip-networking
bind-address = 127.0.0.1
将bind-address =127.0.0.1
前添加一个#就可以了。
接下来就配置登录用户:
mysql默认是不允许远程连接的,因为有很大的安全隐患。。
所以需要手动增加可以远程访问数据库的用户。
下面是连接方式:
# mysql -u root -p
>;
grant select,insert,update,delete on books.* to
[email=root@]senwei@"59.77.243.1[/email]
" Identified by "dbmysql";
----允许地址59.77.243.153上用senwei用户,密码dbmysql来连接mysql的books数据库,付给select,insert,update,delete权限。
grant all on *.* to
[email=root@]senwei@"59.77.243.1[/email]
" Identified by "dbmysql"
允许地址59.77.243.153上用senwei用户,密码dbmysql来连接mysql的所有数据库,付给所有权限。
这样用数据库管理软件就可以远程访问Mysql了。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/65552/showart_972704.html |
|