cmd 进入mysql
我用cmd进入mysql通常情况下是:
mysql -u root -p
然后提示输入密码
进入如下界面
-
Assembly code
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-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
但是现在我进入cmd直接输入mysql然后就进入了
-
Assembly code
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-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
这是什么原因,这不就没有安全性了吗,还是我哪里设置有问题?
你可以 select user, host from mysql.user; 看看有没有 user 为空的用户,另外这个用户一般是指定 localhost 的,所以只有本机可以登录。如果觉得危险,删掉这样的用户就行了呗。
检查 用户是否设置密码
SELECT * FROM mysql.user;
or
SELECT USER();
你直接 show grants 看一下就明白了。你使用应该是默认的用户名。
你的密码在配置文件里面写好了 找到my.ini 然后看[clicent] 是否有passwd项