Author Topic: Warning: mysqli_connect(): (HY000/2002)  (Read 44743 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 »

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #10 on: July 26, 2019, 05:59:09 PM »
I tried
[mysqld]
innodb_buffer_pool_size = 512M

But no solution still not working. Getting same error after 2 days or more days.

This is the Major Problem with panel.

I wanna to know if i will go for Paid Support. This problem will be solved or remains the same.

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #11 on: June 14, 2021, 06:54:49 PM »
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


Hi,

I'm facing the same issue. I hope you have already resolved the issue. Can you please help me out to resolve mine too?

Offline
*****
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #12 on: July 16, 2021, 11:48:15 AM »
> I'm facing the same issue. I hope you have already resolved the issue. Can you please help me out to resolve mine too?

Are you seriously? You must check you SQL server and the root login to the SQL server.
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #13 on: July 16, 2021, 12:34:54 PM »
I'm also having this same error, even following all the tips here the problem still occurs.
Code: [Select]
[root@vps1 ~]# service mysqld restart
Restarting mysqld (via systemctl):  Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.
                                                           [FAILED]
[root@vps1 ~]# systemctl status mariadb.service
● mariadb.service - MariaDB 10.2.36 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: activating (auto-restart) (Result: signal) since Fri 2021-07-16 09:32:22 -03; 4s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 25722 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --basedir=/usr $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signal=ABRT)
  Process: 25686 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 25685 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 25722 (code=killed, signal=ABRT)

Jul 16 09:32:22 vps1.zkservidores.com systemd[1]: Failed to start MariaDB 10.2.36 database server.
Jul 16 09:32:22 vps1.zkservidores.com systemd[1]: Unit mariadb.service entered failed state.
Jul 16 09:32:22 vps1.zkservidores.com systemd[1]: mariadb.service failed.
[root@vps1 ~]# journalctl -xe
Jul 15 08:08:38 vps1.zkservidores.com postfix/pickup[30223]: warning: 5A57684460: message has been queued for 1 days
Jul 15 08:08:38 vps1.zkservidores.com postfix/pickup[30223]: 5A57684460: uid=0 from=<root>
Jul 15 08:08:38 vps1.zkservidores.com postfix/cleanup[15945]: 5A57684460: message-id=<20210715110838.5A57684460@vps1.zkservidores.com>
Jul 15 08:08:38 vps1.zkservidores.com postfix/cleanup[15945]: warning: proxy:mysql:/etc/postfix/mysql-virtual_alias_default_maps.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:38 vps1.zkservidores.com postfix/cleanup[15945]: warning: 5A57684460: virtual_alias_maps map lookup problem for root@vps1.zkservidores.com -- message not accepted, try again later
Jul 15 08:08:38 vps1.zkservidores.com postfix/cleanup[15945]: warning: proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:38 vps1.zkservidores.com postfix/cleanup[15945]: warning: 5A57684460: recipient_bcc_maps map lookup problem -- message not accepted, try again later
Jul 15 08:08:39 vps1.zkservidores.com postfix/pickup[30223]: 5B4AE84460: uid=0 from=<root>
Jul 15 08:08:39 vps1.zkservidores.com postfix/cleanup[15947]: 5B4AE84460: message-id=<20210715110839.5B4AE84460@vps1.zkservidores.com>
Jul 15 08:08:39 vps1.zkservidores.com postfix/cleanup[15947]: warning: proxy:mysql:/etc/postfix/mysql-virtual_alias_default_maps.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:39 vps1.zkservidores.com postfix/cleanup[15947]: warning: 5B4AE84460: virtual_alias_maps map lookup problem for root@vps1.zkservidores.com -- message not accepted, try again later
Jul 15 08:08:39 vps1.zkservidores.com postfix/cleanup[15947]: warning: proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:39 vps1.zkservidores.com postfix/cleanup[15947]: warning: 5B4AE84460: recipient_bcc_maps map lookup problem -- message not accepted, try again later
Jul 15 08:08:40 vps1.zkservidores.com postfix/pickup[30223]: 8516C84460: uid=0 from=<root>
Jul 15 08:08:40 vps1.zkservidores.com postfix/cleanup[15945]: 8516C84460: message-id=<20210715110840.8516C84460@vps1.zkservidores.com>
Jul 15 08:08:40 vps1.zkservidores.com postfix/cleanup[15945]: warning: proxy:mysql:/etc/postfix/mysql-virtual_alias_default_maps.cf lookup error for "webmaster@zkservidores.com"
Jul 15 08:08:40 vps1.zkservidores.com postfix/cleanup[15945]: warning: 8516C84460: virtual_alias_maps map lookup problem for webmaster@zkservidores.com -- message not accepted, try again later
Jul 15 08:08:40 vps1.zkservidores.com postfix/cleanup[15945]: warning: proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf lookup error for "webmaster@zkservidores.com"
Jul 15 08:08:40 vps1.zkservidores.com postfix/cleanup[15945]: warning: 8516C84460: recipient_bcc_maps map lookup problem -- message not accepted, try again later
Jul 15 08:08:41 vps1.zkservidores.com postfix/pickup[30223]: 8648E84460: uid=0 from=<root>
Jul 15 08:08:41 vps1.zkservidores.com postfix/cleanup[15947]: 8648E84460: message-id=<20210715110841.8648E84460@vps1.zkservidores.com>
Jul 15 08:08:41 vps1.zkservidores.com postfix/cleanup[15947]: warning: proxy:mysql:/etc/postfix/mysql-virtual_alias_default_maps.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:41 vps1.zkservidores.com postfix/cleanup[15947]: warning: 8648E84460: virtual_alias_maps map lookup problem for root@vps1.zkservidores.com -- message not accepted, try again later
Jul 15 08:08:41 vps1.zkservidores.com postfix/cleanup[15947]: warning: proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:41 vps1.zkservidores.com postfix/cleanup[15947]: warning: 8648E84460: recipient_bcc_maps map lookup problem -- message not accepted, try again later
Jul 15 08:08:42 vps1.zkservidores.com systemd[1]: mariadb.service holdoff time over, scheduling restart.
Jul 15 08:08:42 vps1.zkservidores.com systemd[1]: Cannot add dependency job for unit systemd-vconsole-setup.service, ignoring: Unit is masked.
Jul 15 08:08:42 vps1.zkservidores.com systemd[1]: Stopped MariaDB 10.2.36 database server.
-- Subject: Unit mariadb.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has finished shutting down.
Jul 15 08:08:42 vps1.zkservidores.com systemd[1]: Starting MariaDB 10.2.36 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
Jul 15 08:08:42 vps1.zkservidores.com mysqld[17979]: 2021-07-15  8:08:42 139974079039680 [Note] /usr/sbin/mysqld (mysqld 10.2.36-MariaDB) starting as process 17979 ...
Jul 15 08:08:42 vps1.zkservidores.com mysqld[17979]: 2021-07-15  8:08:42 139974079039680 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32232)
Jul 15 08:08:42 vps1.zkservidores.com postfix/pickup[30223]: warning: 8722384460: message has been queued for 5 days
Jul 15 08:08:42 vps1.zkservidores.com postfix/pickup[30223]: 8722384460: uid=0 from=<root>
Jul 15 08:08:42 vps1.zkservidores.com postfix/cleanup[15945]: 8722384460: message-id=<20210715110842.8722384460@vps1.zkservidores.com>
Jul 15 08:08:42 vps1.zkservidores.com postfix/cleanup[15945]: warning: proxy:mysql:/etc/postfix/mysql-virtual_alias_default_maps.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:42 vps1.zkservidores.com postfix/cleanup[15945]: warning: 8722384460: virtual_alias_maps map lookup problem for root@vps1.zkservidores.com -- message not accepted, try again later
Jul 15 08:08:42 vps1.zkservidores.com postfix/cleanup[15945]: warning: proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf lookup error for "root@vps1.zkservidores.com"
Jul 15 08:08:42 vps1.zkservidores.com postfix/cleanup[15945]: warning: 8722384460: recipient_bcc_maps map lookup problem -- message not accepted, try again later
Jul 15 08:08:42 vps1.zkservidores.com mysqld[17979]: 2021-07-15  8:08:42 139974079039680 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
Jul 15 08:08:42 vps1.zkservidores.com mysqld[17979]: 2021-07-15  8:08:42 139974079039680 [Note] InnoDB: Uses event mutexes
Jul 15 08:08:42 vps1.zkservidores.com mysqld[17979]: 2021-07-15  8:08:42 139974079039680 [Note] InnoDB: Compressed tables use zlib 1.2.7
Jul 15 08:08:42 vps1.zkservidores.com mysqld[17979]: 2021-07-15  8:08:42 139974079039680 [Note] InnoDB: Using Linux native AIO
Any way to fix, besides those already informed? Did I forget something?

Offline
*****
Re: Warning: mysqli_connect(): (HY000/2002)
« Reply #14 on: July 20, 2021, 11:32:35 AM »
@crashzk the first one who sent a log :) But the incorrect log...
I would try to run MariaDB with the command below to check.

Code: [Select]
su mysql -s /bin/bash -c 'mysqld --defaults-file=/etc/my.cnf &'
But make sure you understand what the command means.
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services