数据库设置远程连接

1、 关闭防火墙
2、 设置权限grant all privileges on *.* to root@"%" identified by 'chai' with grant option
或者grant all on *.* to root@"10.10.1.177" identified by 'chai';
flush privileges;

3、GRANT ALL ON *.* TO 用户名@"%" IDENTIFIED BY "密码" WITH GRANT OPTION;
UPDATE mysql.user SET Password = OLD_PASSWORD('密码') WHERE Host = '%' AND User = '用户名';
FLUSH PRIVILEGES;(这是新建用户)

4、远程登陆数据库的命令行

mysql -u root -p password -h 192.168.1.200 -D database(这样的话password会显示出来)

mysql -u root -p -h 192.168.1.200 (回车要求输入密码,密码不显示)


类别:Mysql 查看评论
posted @ 2008-12-04 11:43  dorothychai  阅读(252)  评论(0编辑  收藏  举报