当前位置:于振海网 > 文摘 >

关闭Mysql远程连接

发布时间:2012年12月30日更新时间:2024年2月13日作者:未知文章ID:7759浏览:

1、登录 Mysql-Server 连接本地 mysql

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\kuco>mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.1.45-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

2、修改 Mysql-Server 用户配置

mysql> USE mysql;
Database changed
mysql> SELECT User, Password, Host FROM user;
+------+----------+-----------+
| User | Password | Host      |
+------+----------+-----------+
| root |          | localhost |
| root |          | %         |
+------+----------+-----------+
2 row in set (0.00 sec)

3、删除第二条记录
mysql>Delete FROM user Where Host="%";

4、验证删除是否成功
mysql> SELECT User, Password, Host FROM user;
+------+----------+-----------+
| User | Password | Host      |
+------+----------+-----------+
| root |          | localhost |
+------+----------+-----------+
1 row in set (0.00 sec)
只剩下一条记录表示删除成功。

顶一下
1
100%
踩一下
0
0%
评论列表 发表评论
推荐文章