Linux 中的 mysql数据库,命令被拒绝的问题(ERROR 1044: Access denied for user ''@'localhost')
khler 2011-02-11 01:33:10 1、在命令模式下直接敲mysql可以进入mysql:
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.1.49-community-log MySQL Community Server (GPL)
。。。
2、创建数据库出错:
mysql> create database tmonitor;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'tmonitor'
mysql>
我明明是root登录的,为什么会是''@'localhost' ?
3、另外,我show一下数据库,却发现没有'mysql'库,咋回事?我记得mysql数据库中默认有个名叫‘mysql’的数据库,用来维护用户名、配置参数等信息的库啊:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)
mysql>
4、如果是因为匿名登录,那我退出重新进入mysql吧:
mysql> exit
Bye
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost ~]#
——访问被拒绝了。。。。。。
各位大牛,这是咋回事?
是不是因为没有‘mysql’数据库,导致根本不存在‘root’这个用户,从而导致认证失败的?