I have been following this (tutorialhttps://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04) keenly and doesn’t even allow me even create a user who can manage database locally. I’m getting an error acess denied for ‘newusername@localhost’ (using password: YES)
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.
Hi @samunyi90,
First, you need to create the user and give him privileges to use/manage the databases you want. In the tutorial this can be found at STEP 3 - Creating a Dedicated MySQL User and Granting Privileges.
Now, if you’ve done that, you need to allow access from outside to your MySQL, the best way is to allow only your IP address.
Next, think you need to check is, if the password you used is correct. More often than not, this is the issue.
Next thing, I’ve seen happen is
Whitespace IS apparently allowed between the -u #uname# but NOT between the -p and #password#
Therefore needed:
Otherwise with white-space between -p mypass mysql takes ‘mypass’ as the db name OR you can use the following command
Additionally, can you post the command you used to create the user?