I run mysql using mysql -u root -p
And then try to create database using : create database acp;
But then I get an error saying : ERROR 1006 (HY000): Can’t create database ‘acp’ .
I changed the permission and owner:group of /var/lib/mysql and all it’s sub directories to mysql:mysql and gave permissions 755 and even tried once with 777 but still the same error :(.
Request some one to please guide me in the right direction. Thank you!
P.S - I followed the LAMP installation tutorial on Digital Ocean and everything else has been setup properly!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This solution don´t work for me, i have the same problem, i follow the steps of the tutorial to install phpmyadmin and mysql, but when i try to create a database with user root… same error can´t create, i try to uninstall all and nothing else, same error.
Did you run:
chown -R mysql:mysql /var/libmysql
or just:
chown mysql:mysql
The -R means recursive, and will change ownership of all files in the directory and subdirectories.
That said, if you’re still using a CHMOD 777, change it. Nothing, ideally, should be using 777 as that means world readable, writeable and executable. So in the rare instance that directory gets exposed, anyone with access could do whatever they want with it.
Glad to see that took care of it :-). If you run in to any other issues, feel free to post again and tag me in it and I’ll do my best to help you out. I don’t work for DigitalOcean, I just help here in the forums :-).
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.