Control Web Panel
WebPanel => MySQL => Topic started by: DragoCom on June 04, 2025, 12:51:04 AM
-
I was working on a website in one of my accounts and I needed to check which account it was created under so I fire up the root cwp and I see this and now no sites can be gotten to due to mysql errors. I looked in both of the mysql password files, the passwords do match ok.
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:
-
Did you just update MariaDB? What OS are you running? Did you confirm the expected r00t password matches between
/ usr / local /cwpsrv/htdocs/resources/admin/include/db_conn.php
and
/ root /.my.cnf
-
Did you just update MariaDB? What OS are you running? Did you confirm the expected r00t password matches between
/ usr / local /cwpsrv/htdocs/resources/admin/include/db_conn.php
and
/ root /.my.cnf
No and Yes I did
-
More errors being thrown. I am able to get into ssh but not cwp:
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Warning: mysqli_connect(): (HY000/2002): No such file or directory 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:
-
I just ran a status on mysql and got the following:
● mariadb.service - MariaDB 10.11.13 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Wed 2025-06-04 03:26:01 CEST; 5s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 52429 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 52401 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] &>
Process: 52399 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 52417 (mariadbd)
Status: "Taking your SQL requests now..."
Tasks: 17 (limit: 379983)
Memory: 150.9M
CGroup: /system.slice/mariadb.service
└─52417 /usr/sbin/mariadbd
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:00 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:00 0 [Note] InnoDB: log sequence number 54626253661; transaction i>
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_>
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:00 0 [Note] Plugin 'FEEDBACK' is disabled.
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:00 0 [Note] Server socket created on IP: '0.0.0.0'.
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:00 0 [Note] Server socket created on IP: '::'.
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:00 0 [Note] /usr/sbin/mariadbd: ready for connections.
Jun 04 03:26:00 viking.dragocom.xyz mariadbd[52417]: Version: '10.11.13-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 Maria>
Jun 04 03:26:01 viking.dragocom.xyz mariadbd[52417]: 2025-06-04 3:26:01 0 [Note] InnoDB: Buffer pool(s) load completed at 250604 3:26:>
Jun 04 03:26:01 viking.dragocom.xyz systemd[1]: Started MariaDB 10.11.13 database server.
-
If MariaDB is up and ready try:
service cwpsrv restart
-
If MariaDB is up and ready try:
service cwpsrv restart
I'll try it again. It's not a space issue:
[root@viking ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 24G 0 24G 0% /dev
tmpfs 24G 0 24G 0% /dev/shm
tmpfs 24G 27M 24G 1% /run
tmpfs 24G 0 24G 0% /sys/fs/cgroup
/dev/mapper/almalinux-root 70G 19G 51G 28% /
/dev/sda1 1014M 366M 649M 36% /boot
/dev/mapper/almalinux-home 1.5T 236G 1.3T 16% /home
tmpfs 4.7G 0 4.7G 0% /run/user/0
[root@viking ~]#
-
This is probably related to the other issue that corrupted your server.
At this point, you might want to just wipe it and start over.
-
If MariaDB is up and ready try:
service cwpsrv restart
Hey overseer, do you which file in CWP I need to edit the username and password for connecting to the mysql db? I know it's in those 2 files it asks me to check but what file is the one for cwp to access the root mysql db?
-
Can you log into mysql with root. If so, please do the following.
cat /root/.my.cnf Copy everything after password=
nano /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
Change that password to the one you copied from .my.cnf
This should get your user panels up and running.
-
Can you log into mysql with root. If so, please do the following.
cat /root/.my.cnf Copy everything after password=
nano /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
Change that password to the one you copied from .my.cnf
This should get your user panels up and running.
I can only vnc in now, I get timed out errors now instead of 502 bad gateway when I try to reach the server but things are still running ok internally I guess because I keep getting emails of excessive pache use and monit started emails.