New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

MariaDB Password Reset Script Doesn't Work

Started by Wonder, October 26, 2025, 10:11:03 PM

Previous topic - Next topic

Wonder

I know this script worked perfectly before.
/scripts/mysql_pwd_reset

I've recently done several installations of CWP 8 (for various tests), and after installing CWP 8 without restarting, if we run the password reset script, it works. However, if we restart CWP 8 after installing it, it no longer works, and from what I can see, we lose access to CWP administration (and therefore, the MariaDB service is inoperative).
I've tested it with both the stock and upgraded versions of MariaDB.

I understand that, over time and with updates, the script has become "outdated."

This is the code that appears when we run it:

[root@server ~]# /scripts/mysql_pwd_reset

Enter the new root password (at least 8 chars).
Or leave it empty if you would like to generate it.
Or press CTRL+C to abort and do not touch it

Enter MySQL root password (NO special characters): testpass9876
Shutting down any mysql processes...
/scripts/mysql_pwd_reset: line 14: [: -eq: unary operator expected
Redirecting to /bin/systemctl stop mariadb.service
/scripts/mysql_pwd_reset: line 26: [: -eq: unary operator expected
Redirecting to /bin/systemctl start mariadb.service
Resetting password... hold on
--------------
UPDATE mysql.user SET Password=PASSWORD('testpass9876'),Authentication_string=PASSWORD('testpass9876') WHERE user='root'
--------------

ERROR 1348 (HY000) at line 1: Column 'Password' is not updatable
Cleaning up...
/scripts/mysql_pwd_reset: line 14: [: -eq: unary operator expected
Redirecting to /bin/systemctl stop mariadb.service

Password reset has been completed

New MySQL root password: testpass9876

Remember to store this password safely!

/scripts/mysql_pwd_reset: line 26: [: -eq: unary operator expected
Redirecting to /bin/systemctl start mariadb.service
[root@server ~]#


cyberspace

#2
Try following:

1. Edit the file:
/scripts/mysql_pwd_reset
2. Find and change the line:
EL_VER=`rpm -qa \*-release | grep -Ei "oracle|redhat|centos|cloudlinux" | cut -d"-" -f3`
to
EL_VER=`rpm -qa \*-release | grep -Ei "oracle|redhat|centos|cloudlinux|epel"| head -n 1 | cut -d"-" -f3`

then run the script /scripts/mysql_pwd_reset to change the password.