If you face such an error —–>

ERROR 1045: Access denied for user: ‘root@localhost’ (using password: NO).

Solution :

You have set a password on the root account. This is a good thing. Start MySQL by:

MySQL -p

and it will prompt for the password.

If you don’t know the password, you can re-run the /scripts/mysql_install_db script to rebuild the MySQL database. You might need to delete the /data/mysql directory to do this, but I’m not positive.

Since you’ve just installed the server this shouldn’t disrupt any existing user/database relationships.

And if there’s no default password- just running “mysql” when logged into the server as root should get you in.

The method to change the password is (as root):
“update mysql.user set password=password(’newpass’) where user=’root’;”

Then try

” mysqladmin -u root -p password ” or ” mysqladmin -u user -password ”

If you’re logged into the server as “root”, then the “-u root” is optional. Mysql will use the currently-logged-in userid unless told otherwise.

If you have any queries regarding this KB, you can contact bodHOST technical support staff.

Popular Posts You May Read

Explore more hosting insights, tips and industry updates.

How to Inspect the Sizes of MySQL Databases and Tables

Examining the size of a MySQL database serves various purposes. Monitoring the size of your…

Clear Cache Extension - A Definitive Guide

Clear Cache Extension: A Definitive Guide

Have you ever updated a website but still seen the old version after refreshing the…

How to Test DNS with Dig and Nslookup

This article explains how to test DNS with dig and nslookup. Testing DNS with dig…