Error establish a database connection

Issue Summary

When I try to access my site, I get the message “error establishing a database connection.” This may have happened when my mac crashed, as that’s been happening lately with my machine and I see a few other posters have had that same issue.

I’m using macOS Monterey version 12.01 and Local version 6.3.

Unfortunately I don’t have a backup of my site, so I tried following the steps here
(Import/Export a WordPress Site - Local) to import a site from my local files onto a new site. When I did that I got the error message: local was unable to import the following SQL files:
(then no files were listed)

Here are my local logs:
local-logs.zip (348.7 KB)

Troubleshooting Questions

Only occurs for one of my local sites. The rest still work fine.

I’m able to create a new plain Wordpress site on local.

1 Like

Hey there I would love any help if possible!

1 Like

Just upgraded to v6.3.0+5756 (from v6.2) and get a database error too when attempting to launch my WP site:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in c:\source\repos\WordPress\app\public\wp-includes\wp-db.php:1688 Stack trace: #0 c:\source\repos\WordPress\app\public\wp-includes\wp-db.php(632): wpdb->db_connect() #1 c:\source\repos\WordPress\app\public\wp-includes\load.php(558): wpdb->__construct('root', 'root', 'local', 'localhost') #2 c:\source\repos\WordPress\app\public\wp-settings.php(124): require_wp_db() #3 c:\source\repos\WordPress\app\public\wp-config.php(93): require_once('C:\\Users\\s...') #4 c:\source\repos\WordPress\app\public\wp-load.php(50): require_once('C:\\Users\\s...') #5 c:\source\repos\WordPress\app\public\wp-blog-header.php(13): require_once('C:\\s...') #6 c:\source\repos\WordPress\app\public\index.php(17): require('C:\\s...') #7 {main} thrown in c:\source\repos\WordPress\app\public\wp-includes\wp-db.php on line 1688

Never experienced this issue before but Adminer still works.

Having db connection errors too after upgrading to v6.3. I posted the exception details but it got flagged as spam so I’m reposting w/o it.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.