mysql命令界面不允许连接NO密码@localhost

时间:2013-10-06 08:32:33

标签: php mysql sql database

我无法看到我在mysql(Windows 7)中创建的数据库列表。

当我打开phpmyadmin时,我能够看到我创建的数据库列表,但无法在命令行上看到它们。

我收到以下错误

  

ERROR 1044(42000):用户'''localhost'访问数据库被拒绝   'dbname1'

我已经完成了这个问题ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db'给出的解决方案,但无法解决问题。

当我在命令提示符下输入SHOW DATABASES;时,mysql只显示两个数据库:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.24-log MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.01 sec)

mysql>

但我也有其他数据库。

我有一个有InnoDB collation的数据库。没有使用SHOW DATABASES;命令显示是否有意义?

如果输入以下命令,那么它也会给我一个错误

mysql> mysql -h localhost -u root -p;
  

错误1064(42000):您的SQL语法有错误;检查   手册,对应右边的MySQL服务器版本   在第1行'mysql -h localhost -u root -p'附近使用的语法

任何帮助都将不胜感激。

0 个答案:

没有答案