DB Error: connect failed


(Mapiiiaji) #1

Dear friends, after upgrade PHP from version 7.2.7 to newer 7.2.8, service stops and appear this error “DB Error: connect failed”. Pleaes help! Thank in advance.


(Anton Raharja) #2

make sure php-mysql also updated and make sure MySQL user can access your database from web

anton


(Mapiiiaji) #3

php-mysql also updated.

“MySQL user can access your database from web”
How to check it? Thank in advance


(Mapiiiaji) #4

php-mysql is also updated. the access level has not changed. Maybe 7.2.8 has an incompatibility with the current version. Because the same situation was until added support 7. Thank in advance


(Anton Raharja) #5

I don’t see any changelog related to mysql:
http://www.php.net/ChangeLog-7.php#7.2.8

anton


(Mapiiiaji) #6

Before upgrade state:

[root@sj45s ~]# playsmsd check
PLAYSMSD_CONF = /etc/playsmsd.conf
PLAYSMS_PATH = /var/www/html
PLAYSMS_LIB = /var/lib/playsms
PLAYSMS_BIN = /usr/local/bin
PLAYSMS_LOG = /var/log/playsms
DAEMON_SLEEP = 1
ERROR_REPORTING = E_ALL ^ (E_NOTICE | E_WARNING)
IS_RUNNING = 1
PIDS schedule = 1749
PIDS ratesmsd = 1751
PIDS dlrssmsd = 1753
PIDS recvsmsd = 1756
PIDS sendsmsd = 1760

[root@sj45s ~]# yum upgrade
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.dc.uz
 * elrepo: ftp.colocall.net
 * epel: epel.scopesky.iq
 * extras: mirror.dc.uz
 * remi-php72: mirror.neolabs.kz
 * remi-safe: mirror.neolabs.kz
 * updates: mirror.dc.uz
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-cli.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-cli.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-common.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-common.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-gd.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-gd.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-json.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-json.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-mbstring.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-mbstring.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-mysqlnd.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-mysqlnd.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-pdo.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-pdo.x86_64 0:7.2.8-1.el7.remi will be an update
---> Package php-xml.x86_64 0:7.2.7-1.el7.remi will be updated
---> Package php-xml.x86_64 0:7.2.8-1.el7.remi will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch         Version                 Repository        Size
================================================================================
Updating:
 php                x86_64       7.2.8-1.el7.remi        remi-php72       3.2 M
 php-cli            x86_64       7.2.8-1.el7.remi        remi-php72       4.8 M
 php-common         x86_64       7.2.8-1.el7.remi        remi-php72       1.1 M
 php-gd             x86_64       7.2.8-1.el7.remi        remi-php72        76 k
 php-json           x86_64       7.2.8-1.el7.remi        remi-php72        62 k
 php-mbstring       x86_64       7.2.8-1.el7.remi        remi-php72       621 k
 php-mysqlnd        x86_64       7.2.8-1.el7.remi        remi-php72       233 k
 php-pdo            x86_64       7.2.8-1.el7.remi        remi-php72       124 k
 php-xml            x86_64       7.2.8-1.el7.remi        remi-php72       204 k

Transaction Summary
================================================================================
Upgrade  9 Packages

Total download size: 10 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/9): php-gd-7.2.8-1.el7.remi.x86_64.rpm                  |  76 kB   00:00     
(2/9): php-mbstring-7.2.8-1.el7.remi.x86_64.rpm            | 621 kB   00:00     
(3/9): php-mysqlnd-7.2.8-1.el7.remi.x86_64.rpm             | 233 kB   00:00     
(4/9): php-pdo-7.2.8-1.el7.remi.x86_64.rpm                 | 124 kB   00:00     
(5/9): php-xml-7.2.8-1.el7.remi.x86_64.rpm                 | 204 kB   00:00     
(6/9): php-7.2.8-1.el7.remi.x86_64.rpm                     | 3.2 MB   00:09     
(7/9): php-common-7.2.8-1.el7.remi.x86_64.rpm              | 1.1 MB   00:13     
(8/9): php-json-7.2.8-1.el7.remi.x86_64.rpm                |  62 kB   00:22     
php-cli-7.2.8-1.el7.remi.x86_6 FAILED                                           
http://mirror.uta.edu.ec/remi/enterprise/7/php72/x86_64/php-cli-7.2.8-1.el7.remi.x86_64.rpm: [Errno 12] Timeout on http://mirror.uta.edu.ec/remi/enterprise/7/php72/x86_64/php-cli-7.2.8-1.el7.remi.x86_64.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
(9/9): php-cli-7.2.8-1.el7.remi.x86_64.rpm                 | 4.8 MB   00:03     
--------------------------------------------------------------------------------
Total                                              226 kB/s |  10 MB  00:46     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : php-json-7.2.8-1.el7.remi.x86_64                            1/18 
  Updating   : php-common-7.2.8-1.el7.remi.x86_64                          2/18 
  Updating   : php-cli-7.2.8-1.el7.remi.x86_64                             3/18 
  Updating   : php-pdo-7.2.8-1.el7.remi.x86_64                             4/18 
  Updating   : php-mysqlnd-7.2.8-1.el7.remi.x86_64                         5/18 
  Updating   : php-7.2.8-1.el7.remi.x86_64                                 6/18 
  Updating   : php-mbstring-7.2.8-1.el7.remi.x86_64                        7/18 
  Updating   : php-xml-7.2.8-1.el7.remi.x86_64                             8/18 
  Updating   : php-gd-7.2.8-1.el7.remi.x86_64                              9/18 
  Cleanup    : php-7.2.7-1.el7.remi.x86_64                                10/18 
  Cleanup    : php-cli-7.2.7-1.el7.remi.x86_64                            11/18 
  Cleanup    : php-gd-7.2.7-1.el7.remi.x86_64                             12/18 
  Cleanup    : php-xml-7.2.7-1.el7.remi.x86_64                            13/18 
  Cleanup    : php-mbstring-7.2.7-1.el7.remi.x86_64                       14/18 
  Cleanup    : php-mysqlnd-7.2.7-1.el7.remi.x86_64                        15/18 
  Cleanup    : php-pdo-7.2.7-1.el7.remi.x86_64                            16/18 
  Cleanup    : php-json-7.2.7-1.el7.remi.x86_64                           17/18 
  Cleanup    : php-common-7.2.7-1.el7.remi.x86_64                         18/18 
  Verifying  : php-7.2.8-1.el7.remi.x86_64                                 1/18 
  Verifying  : php-mysqlnd-7.2.8-1.el7.remi.x86_64                         2/18 
  Verifying  : php-mbstring-7.2.8-1.el7.remi.x86_64                        3/18 
  Verifying  : php-common-7.2.8-1.el7.remi.x86_64                          4/18 
  Verifying  : php-xml-7.2.8-1.el7.remi.x86_64                             5/18 
  Verifying  : php-gd-7.2.8-1.el7.remi.x86_64                              6/18 
  Verifying  : php-cli-7.2.8-1.el7.remi.x86_64                             7/18 
  Verifying  : php-json-7.2.8-1.el7.remi.x86_64                            8/18 
  Verifying  : php-pdo-7.2.8-1.el7.remi.x86_64                             9/18 
  Verifying  : php-common-7.2.7-1.el7.remi.x86_64                         10/18 
  Verifying  : php-7.2.7-1.el7.remi.x86_64                                11/18 
  Verifying  : php-pdo-7.2.7-1.el7.remi.x86_64                            12/18 
  Verifying  : php-json-7.2.7-1.el7.remi.x86_64                           13/18 
  Verifying  : php-gd-7.2.7-1.el7.remi.x86_64                             14/18 
  Verifying  : php-cli-7.2.7-1.el7.remi.x86_64                            15/18 
  Verifying  : php-mbstring-7.2.7-1.el7.remi.x86_64                       16/18 
  Verifying  : php-mysqlnd-7.2.7-1.el7.remi.x86_64                        17/18 
  Verifying  : php-xml-7.2.7-1.el7.remi.x86_64                            18/18 

Updated:
  php.x86_64 0:7.2.8-1.el7.remi          php-cli.x86_64 0:7.2.8-1.el7.remi      
  php-common.x86_64 0:7.2.8-1.el7.remi   php-gd.x86_64 0:7.2.8-1.el7.remi       
  php-json.x86_64 0:7.2.8-1.el7.remi     php-mbstring.x86_64 0:7.2.8-1.el7.remi 
  php-mysqlnd.x86_64 0:7.2.8-1.el7.remi  php-pdo.x86_64 0:7.2.8-1.el7.remi      
  php-xml.x86_64 0:7.2.8-1.el7.remi     

Complete!

After instalition:

root@sj45s ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service


(Arjun Dev) #7

First check your database name, username, password carefully, and all the php extension should have same version. if not solved ping me at skype id ‘adev09@gmail.com’


(Mapiiiaji) #8
[root@sj45s outbox]# yum list installed |grep php
php.x86_64                         7.2.7-1.el7.remi               @remi-php72   
php-cli.x86_64                     7.2.7-1.el7.remi               @remi-php72   
php-common.x86_64                  7.2.7-1.el7.remi               @remi-php72   
php-gd.x86_64                      7.2.7-1.el7.remi               @remi-php72   
php-json.x86_64                    7.2.7-1.el7.remi               @remi-php72   
php-mbstring.x86_64                7.2.7-1.el7.remi               @remi-php72   
php-mysqlnd.x86_64                 7.2.7-1.el7.remi               @remi-php72   
php-pdo.x86_64                     7.2.7-1.el7.remi               @remi-php72   
php-xml.x86_64                     7.2.7-1.el7.remi               @remi-php72   
[root@sj45s outbox]# yum update
Dependencies Resolved
================================================================================
 Package            Arch         Version                 Repository        Size
================================================================================
Updating:
 php                x86_64       7.2.8-1.el7.remi        remi-php72       3.2 M
 php-cli            x86_64       7.2.8-1.el7.remi        remi-php72       4.8 M
 php-common         x86_64       7.2.8-1.el7.remi        remi-php72       1.1 M
 php-gd             x86_64       7.2.8-1.el7.remi        remi-php72        76 k
 php-json           x86_64       7.2.8-1.el7.remi        remi-php72        62 k
 php-mbstring       x86_64       7.2.8-1.el7.remi        remi-php72       621 k
 php-mysqlnd        x86_64       7.2.8-1.el7.remi        remi-php72       233 k
 php-pdo            x86_64       7.2.8-1.el7.remi        remi-php72       124 k
 php-xml            x86_64       7.2.8-1.el7.remi        remi-php72       204 k

Transaction Summary
================================================================================
Upgrade  9 Packages

Total download size: 10 M
Is this ok [y/d/N]: 

it’s identical - installed and upgraded php extensions the same

DB login and passwd is the same.


(Arjun Dev) #9

can you give me the access of your system.


(Mapiiiaji) #10

Yes of course. But I want to note that the problem is also inherited in version 7.2.9.


(Mapiiiaji) #12

With the release of 7.2.10 the problem did not disappear, it is still relevant


(Anton Raharja) #13

Because of this I upgraded my server and use PHP 7.2.10, was PHP 7.0

# php -v
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

Looks good on my playSMS, I don’t need to change anything.

anton


(Mapiiiaji) #14

Thank you for answering Anton! Mr. Arjun connected through TeamViver, I showed him that after the upgrade the service is no longer available.

I can update right now to the latest version of PHP and demonstrate:

I have:
CentOS - 7.5.1804
PlaySMS - 1.4.2
MySQL - 8.0.12

Everything works well before the update. After the update, an error occurs. At the same time, there was no change in the PlaySMS configuration (before and after).

Anton, if you have TeamViewer, I can give you access and demonstrate.

I wanted to update each PHP package separately, in order to understand with what exactly this behavior is connected. But unfortunately, each of them is dependent on the others.

Thanks in advance for your help.

Regards,
Jamshid


(Anton Raharja) #15

Ok Ill try to setup a vps and test with that spec

Anton


(Mapiiiaji) #16

Big thanks Anton.

Regards,
Jamshid


(Arjun Dev) #17

use php 7.0, will resolve your issue


(Anton Raharja) #18

here is my newly created server:

and playSMS 1.4.2 is working properly

can you access mysql from console ? use playSMS database users, try to login to mysql from console, for example your playsms database user is playsms and your playSMS database name is also playsms:

mysql -u playsms -p playsms

anton


(Mapiiiaji) #19

installed a new server, installed all applications:

aaa2

aaa3

as you can see, the playsms account and login to the base playsms from the console without any problems!

the thing is that before the release of version 7.2.8 everything was updated to the new version and there were no problems. yesterday raised a new server and took all these screenshots. Playsms is perfectly installed but does not start. but at the same time you can connect to the database via the console using a Playsms account without any problems, as can be seen in the screenshot.

aaa5


(Anton Raharja) #20

I dont know what you’ve done but clearly I can install with your requirements. Please seek advice from CentOS admin who knows MySQL 8. I dont see any issue with playSMS so far.

anton


(Mapiiiaji) #21

Thanks for answering.
But I want to emphasize that the problem is not in MySQL and not in PHP. Up to version 7.2.7, everything worked perfectly and even from version to version it was updated without problems. But with the exit. 7.2.8 such shoals began. While the error appears in PlaySMS, using the login and password on behalf of the PlaySMS account you can connect to the database and get information, there is no problem with that. The rule for SELInux is also spelled out and it blocks nothing too (I even tried to turn it off, also to no avail). Anton, maybe I’ll give you access and see for yourself if you have such an opportunity?

Thank you earlier.

Regardles,
Jamshid