您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Windows 访问CentOS上MySQL配置说明

2025/12/25 2:33:54发布16次查看
要完成windows上的客户端访问centos上的mysql,就需要做到两点:关闭centos上防火墙;赋予数据库用户远程访问的权限,并清除权限
要完成windows上的客户端访问centos上的mysql,,就需要做到两点:关闭centos上防火墙;赋予数据库用户远程访问的权限,并清除权限的缓存,具体配置如下:
[root@mysql ~]# service iptables stop
iptables: flushing firewall rules:                        [  ok  ]
iptables: setting chains to policy accept: filter          [  ok  ]
iptables: unloading modules:                              [  ok  ]
[root@mysql ~]# mysql -uroot -proot
error 1045 (28000): access denied for user'root'@'localhost'(using password:
[root@mysql ~]# mysql
welcome to the mysql monitor.  commands end with ; or \g.
your mysql connection id is 4
server version: 5.1.66 source distribution
copyright (c) 2000, 2012, oracle and/or its affiliates. all rights reserved.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.
mysql> set password=password('rootroot');
query ok, 0 rows affected (0.00 sec)
mysql> quit
bye
[root@mysql ~]# mysql -uroot -p
enter password:
welcome to the mysql monitor.  commands end with ; or \g.
your mysql connection id is 6
server version: 5.1.66 source distribution
copyright (c) 2000, 2012, oracle and/or its affiliates. all rights reserved.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.
mysql> quit
bye
[root@mysql ~]# mysql -uroot -p
enter password:
welcome to the mysql monitor.  commands end with ; or \g.
your mysql connection id is 11
server version: 5.1.66 source distribution
copyright (c) 2000, 2012, oracle and/or its affiliates. all rights reserved.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.
mysql> grant all on *.* to'root'@'%'identified by 'rootroot';
query ok, 0 rows affected (0.00 sec)
mysql> flush privileges;
query ok, 0 rows affected (0.00 sec)
mysql>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product