Errno 2 when creating database in MySql on Debian

June 13, 2015 1.8k views
MySQL DigitalOcean Debian

I have installed mysql-client and mysql-server, and can successfully login as the root user using the password chosen during installation.

While logged in I am able to create users, but when I try to create a database, I get "errno: 2" error. My google searches suggest that this most likely has to do with file permissions in the mysql data directory, but I wasn't able to find information regarding post-installation permissions in the DO MySql instructions.

Thanks for any advice on how to resolve this error!

  • It is also probably worth noting that when I perform SHOW DATABASES; I only see "information_schema" - various tutorials suggest I should also see "mysql" and "test" databases.

  • Also, the full error message is "ERROR 1006 (HY000): Can't create database 'databasename' (errno: 2)"

Be the first one to answer this question.