我用cmd进入mysql通常情况下是:
mysql -u root -p
然后提示输入密码
进入如下界面C:\Documents and Settings\Administrator>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.19-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.但是现在我进入cmd直接输入mysql然后就进入了C:\Documents and Settings\Administrator>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.19-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>这是什么原因,这不就没有安全性了吗,还是我哪里设置有问题?
mysql -u root -p
然后提示输入密码
进入如下界面C:\Documents and Settings\Administrator>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.19-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.但是现在我进入cmd直接输入mysql然后就进入了C:\Documents and Settings\Administrator>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.19-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>这是什么原因,这不就没有安全性了吗,还是我哪里设置有问题?
SELECT * FROM mysql.user;
or
SELECT USER();
mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| | % |
| root | % |
| | localhost |
| root | localhost |
+------+-----------+
4 rows in set (0.05 sec)内容如下
怎么解释啊,是有一个是空的?
mysql> select password from mysql.user where user='root';
+-------------------------------------------+
| password |
+-------------------------------------------+
| *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+-------------------------------------------+
2 rows in set (0.02 sec)这样搜索如下内容,应该是root用户的密码就是root
不过为什么有了两条记录呢?
|
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS,
FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES,
LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO ''@'local
host' WITH GRANT OPTION |
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
现在如果我用MySQL Command Line Client登录的话,必须输入root才能登录
但是用cmd登录就不用,同时用cmd登录的时候输入root或者是不输入都能登录
麻烦您了