LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 695|回复: 1

mysql root 密码问题

[复制链接]
发表于 2005-2-23 01:27:41 | 显示全部楼层 |阅读模式
我装了mysql, 并且也设置了mysql的root password,但是我发现了一个奇怪的问题。
当我使用系统的root帐户进入系统是提示需要密码,如下:
  1. #mysql
  2. ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
复制代码

使用正确的用户名密码后正常进入:
  1. # mysql -u root -p
  2. Enter password:
  3. Welcome to the MySQL monitor.  Commands end with ; or \g.
  4. Your MySQL connection id is 18 to server version: 4.0.23_Debian-4-log

  5. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

  6. mysql>
复制代码

可是当我用系统的普通用户进入时你看:
  1. $ mysql
  2. Welcome to the MySQL monitor.  Commands end with ; or \g.
  3. Your MySQL connection id is 19 to server version: 4.0.23_Debian-4-log

  4. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

  5. mysql>
复制代码

居然畅通无阻?!!这个是为什么呀?
发表于 2005-2-23 09:01:16 | 显示全部楼层
你要编辑你的my.cnf文件,将密码写进去
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表