mysql -h localhost -u root -p123你就可以连接到 MySQL 服务器了, 然后你可能使用 SQL 语句了,下面是我的屏幕显示 ============================================================================= Microsoft Windows 2000 [Version 5.00.2195] (C) 版权所有 1985-1998 Microsoft Corp.D:\>cd mysql\binD:\mysql\bin>mysql -h localhost -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 to server version: 4.0.4-beta-max-nt-logType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> USE mysql Database changed mysql> SHOW TABLES; +-----------------+ | Tables_in_mysql | +-----------------+ | columns_priv | | db | | func | | host | | tables_priv | | user | +-----------------+ 6 rows in set (0.00 sec)mysql> SELECT Host,User,Password FROM `user`; +-----------+-------+------------------+ | Host | User | Password | +-----------+-------+------------------+ | localhost | root | | | % | root | | | localhost | root2 | 773359240eb9a1d9 | | | | | +-----------+-------+------------------+ 4 rows in set (0.03 sec)mysql>
但是我按哪个格式连接后显示 Lost connection to MySQL server during query是什么意思? 密码不对吗??
Lost connection to MySQL server during query?? 你的服务器担任系统是什么系统 MySQL 版本?当你的 MySQL 服务在运行8小时内没有任何连接, 那你在连接服务器时可能会出现这种情况, 你需要将 MySQL 服务重新启动一下
然后你可能使用 SQL 语句了,下面是我的屏幕显示
=============================================================================
Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-1998 Microsoft Corp.D:\>cd mysql\binD:\mysql\bin>mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.4-beta-max-nt-logType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> USE mysql
Database changed
mysql> SHOW TABLES;
+-----------------+
| Tables_in_mysql |
+-----------------+
| columns_priv |
| db |
| func |
| host |
| tables_priv |
| user |
+-----------------+
6 rows in set (0.00 sec)mysql> SELECT Host,User,Password FROM `user`;
+-----------+-------+------------------+
| Host | User | Password |
+-----------+-------+------------------+
| localhost | root | |
| % | root | |
| localhost | root2 | 773359240eb9a1d9 |
| | | |
+-----------+-------+------------------+
4 rows in set (0.03 sec)mysql>
Lost connection to MySQL server during query是什么意思?
密码不对吗??
你的服务器担任系统是什么系统
MySQL 版本?当你的 MySQL 服务在运行8小时内没有任何连接,
那你在连接服务器时可能会出现这种情况,
你需要将 MySQL 服务重新启动一下
在glibc某些版本中,gethostbyaddr函数(确切地说是_nss_dns_gethostbyaddr_r)存在缓冲区溢出问题,在处理大数据时会造成SEGMENT FAULT。在处理远程连接时,mysqld会调用ip_to_hostname()函数,再由这个函数调用gethostbyaddr函数,最后系统在执行nss_dns_gethostbyaddr_r函数处崩溃。因此,会出现上述情况。解决问题的办法是升级glibc。