SQL ERROR [ mysql4 ] Access denied for user 'root'@'localhost' (using password: NO) [1045]

After reintalling virtuamin, my website’s forum on phpBB is giving the error:
General Error
SQL ERROR [ mysql4 ]

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

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

Might not be a specific virtualmin issue, however I have tried readding the password, password.

I also tried:

/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD(“newrootpassword”) where User=‘root’;
mysql> flush privileges;
mysql> quit
/etc/init.d/mysqld stop
/etc/init.d/mysqld start

Any suggestions welcome.

Are you actually using your forum with “root” as the database user?

You’re aware that, if your forum gets compromised and hackers can read your forum’s config file, they will have root access to your database server, right?

Also, what does “reinstall Virtualmin” mean? What exactly did you “reinstall”, and how?

Thanks for the reply.
I cannot afford paid support at this point in time Locutus, which is why I post on the forum for community support to work with learners of the virtualmin software.

I’m using the standard default folder the phpbb forum places the forum on the virtualmin software.

No big deal re database as only the forum is on it and nothing sensitive as it’s a community help forum for the public anyways.

Will get into more security when things run reliably for an acceptable time frame.

Reinstall Virtualmin means I couldn’t log into Virtualmin as the password somehow changed, so I backed up the HDD, wiped the HDD, reinstalled Centos and then virtualmin and uploaded the previously working website with the previously working forum.

Security considerations aside (“sensitive” is not just your database, but unwanted access to your server in general!), the error message would imply that your forum is trying to access the database without supplying a password. You might want to check its configuration.

So, this issue has arisen again after reinstalling virtualmin and rebuilding the website.
I have navigated to Virtualmin > Edit Databases > Manage… > This database has no tables.

So, how do I change the user from root to a non root user.
The password issue is what I’m trying to fix first for the website forum, which uses this MySQL database.
In Virtualmin > Edit Databases > Passwords > I have the option of
MySQL database:
Same as administration password (default selected)
or
Custom password

You might want to create a new user in the virtual server and assign them access rights to the database. Then you use that user and their password in your web software configuration. (Note that MySQL user names are limited to I think 16 chars, so the MySQL user name might differ from the Linux one. The user details page shows the MySQL user name if it’s different.)