Author Topic: Warning: mysqli_connect(): (HY000/2002)  (Read 332 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Warning: mysqli_connect(): (HY000/2002)
« on: December 11, 2018, 06:17:49 AM »
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:


Please i need a fix to this error

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #1 on: December 11, 2018, 08:34:00 AM »
first, check that mysql is working and that you have the ability to connect on it, you can do that from the shell.


if all is ok then try to reset mysql password

sh /scripts/mysql_pwd_reset
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #2 on: December 12, 2018, 05:14:34 AM »
Please how do i check if mysql is okay and connecting before i reset the password

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #3 on: December 12, 2018, 05:20:11 AM »
Sorry i just checked and it's not working please i need a fix to this error

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #4 on: December 12, 2018, 08:23:20 AM »
if mysql is not working then you need to check it with your system admin or cwp support as it can be any issue.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #5 on: December 13, 2018, 02:57:17 AM »
Please i need a walk through on this

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #6 on: December 14, 2018, 05:47:14 AM »
I have the same problem a lot of times.

The website doesnt work and when I login in the CWP the problem is fixed automatically.

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #7 on: December 14, 2018, 08:08:57 AM »
This happen because your mysql stopped working

- check log of your mysql.log
Quote
$ tail -n 50 /var/lib/mysql/<srv.domain.com.err>

- It can be your innodb_buffer_pool_size need to increase
Quote
$ nano /etc/my.cnf

Insert Below Line :

Quote
[mysqld]
innodb_buffer_pool_size = 512M

- Then restart mysqld
Quote
$ service mysqld restart

If your server still goes down try to increase size of innodb_buffer_pool_size, maybe your server need more RAM.

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #8 on: December 15, 2018, 02:31:36 AM »
Warning: mysqli_connect(): (HY000/1049): Unknown database 'root_cwp' 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/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

Warning: mysqli_connect(): (HY000/1049): Unknown database 'root_cwp' 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 tried doing all that now i got this error please i need a solution to this

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #9 on: December 15, 2018, 08:22:03 PM »
This happen because your mysql stopped working

- check log of your mysql.log
Quote
$ tail -n 50 /var/lib/mysql/<srv.domain.com.err>

- It can be your innodb_buffer_pool_size need to increase
Quote
$ nano /etc/my.cnf

Insert Below Line :

Quote
[mysqld]
innodb_buffer_pool_size = 512M

- Then restart mysqld
Quote
$ service mysqld restart

If your server still goes down try to increase size of innodb_buffer_pool_size, maybe your server need more RAM.

Thank you very much.

How much innodb_buffer_pool_size is ok for a server with 8 gb ram ???? I have read 80%... so 5 or 6G is ok?
I dont want see that error again. I wish you are right and it could be the solution.
« Last Edit: December 15, 2018, 08:46:40 PM by edur »