MySQL permissions error when showing databases

Posted by Tony on Server Fault See other posts from Server Fault or by Tony
Published on 2010-06-09T15:39:06Z Indexed on 2010/06/09 15:42 UTC
Read the original article Hit count: 199

Filed under:
|

I was trying to install homebrew and very very stupidly did this:

sudo chown -R $USER /usr/local

The Homebrew instructions say to do this and I'm not much of a sysadmin so I took their word for it. Lesson learned (although I wouldn't really know how to test this...seems like an "undo" script would be super valuable here)

Anyway, what is done is done, but now I get this error:

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 548
Server version: 5.1.33 Source distribution

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

mysql> show databases;
ERROR 1018 (HY000): Can't read dir of '.' (errno: 13)

I tried chown-ing back to root with no avail. Does anyone know how I can fix this without reinstalling mysql? Optionally, if I have to reinstall mysql, how can I dump my databases without access to the command line so I don't lose all of my data.

Thanks!

© Server Fault or respective owner

Related posts about mysql

Related posts about permissions