By greg535417
Hi guys, I am very new to using a service like digitalocean (opposed to a one click setup of mediatemple or godaddy) and I am trying to setup and configure a new DB using MySQL but I keep getting the error
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I have googled this, and searched the community for answers but cannot seem to solve this issue. Am I missing something? I have tried running it as root, and running it with sudo through another user and cannot get around it. If I offer no password it gives the same error but instead of using password: YES, it’s NO.
Thanks.
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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Installed mysql - 5.7. I Had the same issue.
Tried the below steps:
1. dpkg --get-selections | grep mysql (to get the version of mysql).
2. dpkg-reconfigure mysql-server-5.7
3. mysql -u root -p
Without -p that doesn’t prompt you to ask password. Once you are in, you can create a user with a password by following steps :
CREATE USER ‘-your_name-’@‘your-hostname’ IDENTIFIED BY ‘your-password’;
GRANT ALL PRIVILEGES ON . to ‘-your_name-’@‘your-hostname’ WITH GRANT OPTION;
Exit from the root and login from the you gave above.
mysql -u -p
For some reason still just typing mysql does not work. AT ALL. Please let me know if this works, else I have other steps.
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.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
