projectnami icon indicating copy to clipboard operation
projectnami copied to clipboard

Upgrade Lost Database connection

Open mrmav3n opened this issue 5 years ago • 5 comments

Stand alone sql and iis on the same server Upgraded from 1.9.6 to 2.20 Updated Php to 7.27 in iis Updated to the Microsoft Drivers 5.3 for PHP v7.2 for SQL Server in IIS. tried removing symbols from the password for the sql account tried making sql account sa At a total loss as what to do next. Existing site lost its ability to connect to the database.

Fatal error: Uncaught Error: Call to undefined function mysql_error() in C:\inetpub*\wp-includes\wp-db.php:3437 Stack trace: #0 C:\inetpub*\wp-includes\wp-db.php(1606): wpdb->bail('

Error estab...', 'db_connect_fail') #1 C:\inetpub*****************\wp-includes\wp-db.php(647): wpdb->db_connect() #2 C:\inetpub\brandnewbusinesses.com\wp-includes\load.php(414): wpdb->__construct('

, 'wp_database', 'localhost') #3 C:\inetpub**************************\wp-settings.php(120): require_wp_db() #4 C:\inetpub***\wp-config.php(100): require_once('C:\inetpub\bran...') #5 C:\inetpub*\wp-load.php(37): require_once('C:\inetpub\bran...') #6 C:\inetpub*\wp-blog-header.php(13): require_once('C:\inetpub\bran...') #7 C:\inetpub********\index.php(17): require('C:\inetpub\bran...') #8 {main} thrown in C:\inetpub*\wp-includes\wp-db.php on line 3437

mrmav3n avatar May 16 '19 19:05 mrmav3n

First things first, drop version 2.1.1 on there and see if that clears up the immediate problem.

patrickebates avatar May 16 '19 20:05 patrickebates

I rolled the server back to backup from early this morning and its back now but at the 1.9.6 level. I guess it would be nice to have some sort matrix of what versions need what php and driver and cache software.

mrmav3n avatar May 16 '19 20:05 mrmav3n

I'm still looking for the path which took you into those functions in the first place. They existed in 2.1.1 but should not be accessible.

As for matching PHP and SqlSrv, I recommend using the Web Platform Installer from MS. It does a very good job of helping you align everything.

patrickebates avatar May 16 '19 20:05 patrickebates

I do use the web platform installer for all those installs. As for my path. I downloaded the latest zip of the 2.2.0 and overwrote the folder.....not before backing it up. when it came up i had the database connection error. Researched and updated php to 7.2.7 then updated the matching drivers and cache software via the web platform installer then tried everything else i mentioned. But yea was a royal mess

mrmav3n avatar May 16 '19 20:05 mrmav3n

Wanted to bring this back up again mainly due to the small outage our internet had and constantly getting the error. image Here is the full image of the issue.

Looking back there seems to be 2 other instances of fixes before for it. Alter new MySQL error handling to conform to our MSSQL standards and Handle MSSQL Server errors in a similar fashion MySQL errors were han… This looks like simple the code for handling errors has changed since 2014 and hasn't been updated to change back into SQL format.

This looks to be a simple fix using sqlsrv_errors().

A-Matt avatar Oct 08 '19 10:10 A-Matt