I'm running a Homebrew install of MySQL 5.7.14 on my Mac, El Capitan 10.11.6 and I can't create databases when logged in with my 'root' user. I get the error,
MySQL: ERROR 1006 (HY000) Can't create database 'db_name' (errno: 26469527)
I don't believe that this is the same as other common errors I've read about with creating databases, which are the result of a lack of permissions. I ran SHOW GRANTS 'root'; and root seems to have full permissions.
I'm new to sql so I apologize if this is an easy fix that I just missed.
If any other information would be helpful let me know.
I'm using
I had a similar issue. What I didn't notice was after brew install mysql
you need to
mysql_secure_installation
After I did the above I was able to setup a user with password and create database without issues. I tried some of the other suggestions and change the mysql data directory's permission but it didn't work. Running mysql_secure_installation
also failed without rebooting the system first. I'm sure there are probably fixes that doesn't require the reboot, but I didn't spend time digging further.
Try changing the permissions or ownership of your MySQL data directory. Likely, the data directory is owned by root but the MySQL process is running under the user mysql.
To find out where your data directory is located, from shell/console, type in:
mysqladmin variables | grep datadir
The directory will be shown on the right hand side. Lets say the directory is /var/lib/mysql, then, from the shell/console, type in:
chown -R mysql:mysql /var/lib/mysql
That's assuming that your MySQL process is running as the user mysql.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With