北京网帮你
Linux下mysql关闭/开启远程连接
时间:2017-04-27 21:16:36 浏览:130

1登陆mysql

[root@iZ94dzha7eeZ ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 74
Server version: 5.1.73-log MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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.
2关闭远程
mysql> use mysql
Database changed
mysql> update user set host = "localhost" where user = "root" and host= "%";
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

mysql>
3开启远程链接一样

update user set host = "%t" where user = "root" and host= "%";

[上一篇]Thinkphp3.2包含查询和不包含查询
[下一篇]2017生活淘宝,淘宝越来越普,用企

Copyright 2014 wbnsp.com copyright, all rights reserved

2014 版权所有 红花岗区网帮你信息技术工作室

工信部备案号: 黔ICP备14004469号

扫描二维码用手机发部信息