开发者

I can't access some of my databases in MySQL (I get: Unknown database '[my-database-name]')

开发者 https://www.devze.com 2023-03-22 16:39 出处:网络
I\'ve been going insane with this, trying to figure out where I could possibly be goin开发者_Python百科g wrong.

I've been going insane with this, trying to figure out where I could possibly be goin开发者_Python百科g wrong. I have this strange feeling it's some sort of permissions issue, but I don't know how to solve it.

I have just decided to move to MAMP, and I've moved all my database folders to the db/mysql folder, but they just aren't showing up for me in phpMyAdmin, nor can I connect to them via PHP. I get:

1049: Unknown database '[my-database-name]'

Trying to access them from Sequel Pro doesn't work either, they just don't show up.

  • CHMODing them to 0777 doesn't do anything.
  • CHWONing them to bruno:admin (my user and group) doesn't do anything.
  • Creating a new database with phpMyAdmin works fine, and the database shows up and I can use it.

A sure-fire way around this is to go to Windows (wouldn't get permission issues there), export all the databases as SQL, then import them on my Mac. But that seems like such a stupid way to get around it. There's got to be a more intelligent way, and I want to understand WHY this is not working, I want to know what's wrong.

P.S. The oddest thing is, I didn't have these problems when I was using a regular MySQL installation, it's only now that I've moved databases over to MAMP's MySQL that this started happening.

Additional Information:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.10 sec)

mysql> show grants;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '[removed]' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)


Just try to login to the db from console and try show databases or show grants to see if you have permissions.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号