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.

What are some NPM commands you should know?

Managing packages is a daily effort while working on JavaScript or Node.js projects. This is…

How to Incorporate a New Link into the WordPress Sidebar

Adding a custom link to your WordPress sidebar helps improve site navigation, highlight important pages,…

Webalizer Stats Not Updating for a Single User

Webalizer is a popular tool in cPanel/WHM that generates website traffic statistics. Sometimes, you may…