Control Web Panel
WebPanel => CentOS-WebPanel Bugs => Topic started by: amlanrd on June 14, 2021, 08:35:04 PM
-
Suddenly I got this error while trying to login to the CWP Control panel.
Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Trying to start mysql server, please wait!
Try to restart CentOS 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
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 have tried resetting the root password too. Also I have checked and confirm that the root password is same in both /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf
Someone please help.
-
Paste the last contents of this log file
/var/lib/mysql/your-HOSTNAME.err
To do this use SSH. open the file using vi /var/lib/mysql/your-HOSTNAME.err
Also do the same for this log - /var/log/cwp_client_login.log
-
such files not available in the mentioned directories.
-
replace your-HOSTNAME with your actual hostname
-
I got you, but the files doesn't exist. I only have the last file i.e. cwp_client_login.log
2021-06-16 21:08:38 root Successful Login from: 59.94.72.224 on: https://localhost:2031/login/index.php
2021-06-16 21:15:17 root Successful Login from: 59.94.72.224 on: https://localhost:2031/login/index.php
2021-06-16 21:19:07 root Successful Login from: 59.94.72.224 on: https://localhost:2087/login/index.php
-
Try update CWP from ssh
sh /usr/local/cwpsrv/htdocs/resources/scripts/update_cwp
-
Getting the same error while updating cwp too:
[root@vmi426849 ~]# sh /usr/local/cwpsrv/htdocs/resources/scripts/update_cwp
====================================================
============= CentOS Web Panel Cron ================
====================================================
###########################
Firewall Flush Daily Blocks
###########################
######################
Update Server Packages
######################
PHP Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
PHP Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
PHP Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/resources/admin/include/cron.php on line 0
PHP Warning: mysqli_select_db() expects parameter 1 to be mysqli, boolean given in /usr/local/cwpsrv/htdocs/resources/admin/include/cron.php on line 0
[root@vmi426849 ~]#
-
Reset MySQL password by first stopping all processes using mysql
killall mysqld
then start mysql removing all permissions
mysqld_safe --skip-grant-tables
Now reset the password with sql query update user set Password=PASSWORD('your-new-password') where user='root';
Flush privileges and restart mysql service service restart mysql
-
Syntax error after 3rd step:
[root@vmi426849 ~]# killall mysqld
[root@vmi426849 ~]# mysqld_safe --skip-grant-tables
210617 14:25:06 mysqld_safe Logging to '/var/lib/mysql/vmi426849.cubinix.com.err'.
210617 14:25:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[root@vmi426849 ~]# update user set Password=PASSWORD('5d89TF5Ug3N06qg') where user='root';
-bash: syntax error near unexpected token `('
[root@vmi426849 ~]#
-
The last command is a mysql command open mysql from ssh using command
mysql --user=root mysql
-
Hi,
I tried something else and it fixed almost 90% of the issue.
1. I have taken backup of the database folders from /var/lib/mysql/
2. Removed MariaDB and the directories.
3. Reinstalled the MariaDB.
4. Copied the backed up database folders to /var/lib/mysql/
5. Granted permissions to the folder.
6. Reset myswl password.
Now I can login to my CWP. But still I'm getting the following error message in the header area:
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'postfix'@'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 'postfix'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Also, the FTP Server showing failed in the CWP Dashboard. If I try to start, it shows:
Failed to start pure-ftpd.service: Unit pure-ftpd.service not found.
-
I have fixed the postfix issue. And for FTP issue, I have reinstalled pure-ftpd. The FTP service is now started. But in the FTP status I noticed this line:
Jun 17 22:48:10 vmi426849.cubinix.com systemd[1]: pure-ftpd.service: Can't open PID file /var/run/pure-ftpd.pid (yet?) after start: No such file or directory
Please help!
-
chown root:pure-ftpd /var/run/pure-ftpd.pid
chmod 755 /var/run/pure-ftpd