0

I am not able to see the list of Databases which I have created in mysql (windows 7).

When I open phpmyadmin then I am able to see the list of Databases which I have created but not able to see them on command line.

I am getting following error

ERROR 1044 (42000): Access denied for users ''@'localhost' to database 'dbname1'

I have gone through the solutions given on this question ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db' but could not solved the issue.

When I enter SHOW DATABASES; on command prompt, mysql only shows two databases:

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>

But I have other Databases too.

I have one DB which has InnoDB collation. Does it makes any sense for not displaying using SHOW DATABASES; command?

If is enter below command then it also gives me an error

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

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -h localhost -u root -p' at line 1

Any help would be appreciated.

Community
  • 1
  • 1
Smile
  • 2,770
  • 4
  • 35
  • 57
  • Try `mysql> quit;`, then `mysql -h localhost -u root -p;`. You may have no access permissions to use other databases. In this case they might be not displayed. – BlitZ Oct 06 '13 at 08:35
  • @CORRUPT, on Windows+R where we write other commands? Or in command prompt? – Smile Oct 06 '13 at 08:36
  • 1
    In command prompt. For second case, you were just need to close current mysql session and reconnect. That's why it give you an error (it was "assuming" that you tried to execute a query). You tried to reconnect from current session. `Windows + R`, then `cmd`, then `mysql -h localhost -u root -p;` – BlitZ Oct 06 '13 at 08:38
  • @CORRUPT Now it giving same error with `(using password:YES)` in addition with previous error :( – Smile Oct 06 '13 at 08:46
  • 1
    Try to do same actions with `mysql -h localhost -u root`. Also, I believe that your question more suites for http://http://dba.stackexchange.com/ . – BlitZ Oct 06 '13 at 08:49
  • @CORRUPT, a link you provided is not opening at my end :( but I opened it as you suggested. Still 2 db are shown as I mentioned above. If I try to open DB which is not listed then it gives same error – Smile Oct 06 '13 at 08:55
  • Misspelled, sorry ): http://dba.stackexchange.com/ Also, see this question: http://stackoverflow.com/questions/13180721/cant-access-to-some-database-being-root-after-just-creating-that-database – BlitZ Oct 06 '13 at 08:56
  • @CORRUPT `GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'` I used this command but no success – Smile Oct 06 '13 at 09:16
  • Have you restarted your database server? Have you `FLUSH`ed privileges? If there are no success, there is nothing I can help you with. Let's hope someone else will suggest an answer. – BlitZ Oct 06 '13 at 09:20
  • How are you accessing phpmyadmin? – Burhan Khalid Oct 06 '13 at 11:28
  • Opening it from `Windows+R` and `mysql` – Smile Oct 07 '13 at 04:13

0 Answers0