Author Topic: root myql password  (Read 36 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
root myql password
« on: October 15, 2025, 08:20:47 AM »
Hello,
I change root mysql password by mistake and now:

Code: [Select]
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0


Trying to start mysql server, please wait!
Try to restart Control Web Panel with command: sh /scripts/restart_cwpsrv

**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf
You can reset the MySQL root password fast with this command: /scripts/mysql_pwd_reset -q


Warning: mysqli_error() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Could not connect:

My server is with Almalinux 9 and
Mariadb  Ver 15.1 Distrib 10.11.14-MariaDB

 I try to edit this script to adapt: 
Code: [Select]
/scripts/mysql_pwd_reset

Quote
Enter MySQL root password (NO special characters): Yaj0ahLvXm
Shutting down any mysql processes...
Resetting password... hold on
--------------
UPDATE mysql.user SET Password=PASSWORD('Yaj0ahLvXm'),Authentication_string=PASSWORD('Yaj0ahLvXm') WHERE user='root'
--------------

ERROR 1348 (HY000) at line 1: Column 'Password' is not updatable
Cleaning up...

Password reset has been completed

New MySQL root password: Yaj0ahLvXm

However the problem is not solved :(

Could you help me?

ERROR 1348 (HY000) at line 1: Column 'Password' is not updatable


How can I adapt the code -> /scripts/mysql_pwd_reset so that this error doesn't occur and the password changes correctly?
« Last Edit: October 15, 2025, 08:37:12 AM by setecabanas »

Offline
*****
Re: root myql password
« Reply #1 on: October 15, 2025, 10:42:52 AM »
That script seems to be outdated and shouldn't be used. Please use this guide instead:
https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password

Offline
*
Re: root myql password
« Reply #2 on: October 15, 2025, 12:26:23 PM »
I think the problem is other:  I've broken my MySQL installation :(


Code: [Select]
[root@s3 mysql]# systemctl status mariadb
× mariadb.service - MariaDB 10.6.23 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; preset: disabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: failed (Result: exit-code) since Wed 2025-10-15 12:23:52 UTC; 3s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 16501 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 16502 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=e>
    Process: 16510 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 16510 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"
        CPU: 140ms

Oct 15 12:23:52 s3 mariadbd[16510]: 2025-10-15 12:23:52 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
Oct 15 12:23:52 s3  mariadbd[16510]: 2025-10-15 12:23:52 0 [Note] InnoDB: Starting shutdown...
Oct 15 12:23:52 s3  mariadbd[16510]: 2025-10-15 12:23:52 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Oct 15 12:23:52 s3 mariadbd[16510]: 2025-10-15 12:23:52 0 [Note] Plugin 'FEEDBACK' is disabled.
Oct 15 12:23:52 s3  mariadbd[16510]: 2025-10-15 12:23:52 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engine 'Aria'". Some plugins may be not loaded
Oct 15 12:23:52 s3  mariadbd[16510]: 2025-10-15 12:23:52 0 [ERROR] Failed to initialize plugins.
Oct 15 12:23:52 s3  mariadbd[16510]: 2025-10-15 12:23:52 0 [ERROR] Aborting
Oct 15 12:23:52 s3  systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 15 12:23:52 s3  systemd[1]: mariadb.service: Failed with result 'exit-code'.

I think I'll have to reinstall everything.

Thanks anyway ;)

Offline
*****
Re: root myql password
« Reply #3 on: October 15, 2025, 01:13:35 PM »
You should remove your current MariaDB 10.6 and install 10.11 (LTS version). This will preserve your DB and get you to a current, supported version:
https://www.alphagnu.com/topic/23-upgrade-mariadb-1011-in-cwp-centos-7-centos-8-stream-almalinux-78-rockylinux-78/