Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: Brokenskull247 on December 11, 2018, 06:17:49 AM

Title: Warning: mysqli_connect(): (HY000/2002)
Post by: Brokenskull247 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
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: studio4host 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
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: Brokenskull247 on December 12, 2018, 05:14:34 AM
Please how do i check if mysql is okay and connecting before i reset the password
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: Brokenskull247 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
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: studio4host 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.
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: Brokenskull247 on December 13, 2018, 02:57:17 AM
Please i need a walk through on this
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: edur 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.
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: randyproxz 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.
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: Brokenskull247 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
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: edur 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.
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: quickwebworks 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.
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: amlanrd 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?
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: Igor S. 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.
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: crashzk 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?
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: Igor S. 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.
Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: protv on September 19, 2021, 06:48:32 AM
i had this problem some part has been fixed but still cannot log in into cwp panel or even wordpress  ( Error establishing a database connection) what can i do or at least how can i migrate my wordpress data to another cloud service


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 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:






Redirecting to /bin/systemctl status mysql.service

● mariadb.service - MariaDB 10.6.4 database server

   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor pre                                                                                                                                                             set: disabled)

  Drop-In: /etc/systemd/system/mariadb.service.d

           └─migrated-from-my.cnf-settings.conf

   Active: active (running) since Thu 2021-09-16 09:06:14 EDT; 666ms ago









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 '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/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 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:
















Title: Re: Warning: mysqli_connect(): (HY000/2002)
Post by: Igor S. on October 04, 2021, 08:09:15 AM
Try the command: sh /scripts/mysql_pwd_reset
**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf