Title: Fatal error: Uncaught mysqli_sql_exception:
Last modified: May 9, 2024

---

# Fatal error: Uncaught mysqli_sql_exception:

 *  Resolved [Romanko](https://wordpress.org/support/users/romanko/)
 * (@romanko)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception-2/)
 * Hi, I have a wordpress site backup from 2021 and recently decided to revive it.
   I have uploaded the files to the hosting and the database. But I get this error
   on the domain now>
 * **Deprecated**: Optional parameter $content declared before required parameter
   $post is implicitly treated as a required parameter in **/home/cdcearth/public_html/
   wp-includes/functions.php** on line **840**
 * **Fatal error**: Uncaught mysqli_sql_exception: Access denied for user ‘cdcearth_adminko’@’localhost’
   to database ‘cdcearth_cdc’ in /home/cdcearth/public_html/wp-includes/wp-db.php:
   1084 Stack trace: #0 /home/cdcearth/public_html/wp-includes/wp-db.php(1084): 
   mysqli_select_db(Object(mysqli), ‘cdcearth_cdc’) #1 /home/cdcearth/public_html/
   wp-includes/wp-db.php(1718): wpdb->select(‘cdcearth_cdc’, Object(mysqli)) #2 /
   home/cdcearth/public_html/wp-includes/wp-db.php(632): wpdb->db_connect() #3 /
   home/cdcearth/public_html/wp-includes/load.php(482): wpdb->__construct(‘cdcearth_admink…’,‘
   password’, ‘cdcearth_cdc’, ‘localhost’) #4 /home/cdcearth/public_html/wp-settings.
   php(124): require_wp_db() #5 /home/cdcearth/public_html/wp-config.php(90): require_once(‘/
   home/cdcearth/…’) #6 /home/cdcearth/public_html/wp-load.php(37): require_once(‘/
   home/cdcearth/…’) #7 /home/cdcearth/public_html/wp-blog-header.php(13): require_once(‘/
   home/cdcearth/…’) #8 /home/cdcearth/public_html/index.php(17): require(‘/home/
   cdcearth/…’) #9 {main} thrown in **/home/cdcearth/public_html/wp-includes/wp-
   db.php** on line **1084**
 * I am no expert in php, can anyone help? Thank you very much.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception-2/#post-17744995)
 * Try reviewing [https://www.arrayoverflow.com/question/PHP—Error-%3A-Deprecated%3A-Optional-parameter-declared-before-required-parameter/3593#:~:text=To%20solve%20this%2C%20simply%20move%20the%20optional%20parameter,and%20ensure%20that%20the%20function%20works%20as%20expected](https://www.arrayoverflow.com/question/PHP—Error-%3A-Deprecated%3A-Optional-parameter-declared-before-required-parameter/3593#:~:text=To%20solve%20this%2C%20simply%20move%20the%20optional%20parameter,and%20ensure%20that%20the%20function%20works%20as%20expected).
 *  Thread Starter [Romanko](https://wordpress.org/support/users/romanko/)
 * (@romanko)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception-2/#post-17748385)
 * thank you, the deprecated error is no more. But the database error remains still.
   Can anyone help me please? Thank you very much.
 * **Fatal error**: Uncaught mysqli_sql_exception: Access denied for user ‘cdcearth_adminko’@’localhost’
   to database ‘cdcearth_cdc’ in /home/cdcearth/public_html/wp-includes/wp-db.php:
   1084 Stack trace: #0 /home/cdcearth/public_html/wp-includes/wp-db.php(1084): 
   mysqli_select_db(Object(mysqli), ‘cdcearth_cdc’) #1 /home/cdcearth/public_html/
   wp-includes/wp-db.php(1718): wpdb->select(‘cdcearth_cdc’, Object(mysqli)) #2 /
   home/cdcearth/public_html/wp-includes/wp-db.php(632): wpdb->db_connect() #3 /
   home/cdcearth/public_html/wp-includes/load.php(482): wpdb->__construct(‘cdcearth_admink…’,‘
   password’, ‘cdcearth_cdc’, ‘localhost’) #4 /home/cdcearth/public_html/wp-settings.
   php(124): require_wp_db() #5 /home/cdcearth/public_html/wp-config.php(90): require_once(‘/
   home/cdcearth/…’) #6 /home/cdcearth/public_html/wp-load.php(37): require_once(‘/
   home/cdcearth/…’) #7 /home/cdcearth/public_html/wp-blog-header.php(13): require_once(‘/
   home/cdcearth/…’) #8 /home/cdcearth/public_html/index.php(17): require(‘/home/
   cdcearth/…’) #9 {main} thrown in **/home/cdcearth/public_html/wp-includes/wp-
   db.php** on line **1084**
 *  Thread Starter [Romanko](https://wordpress.org/support/users/romanko/)
 * (@romanko)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception-2/#post-17748395)
 * Nevermind, it happens if you don’t set the permissions for the user of the database.
   It is working now.
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception-2/#post-17748478)
 * Glad its sorted 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal error: Uncaught mysqli_sql_exception:’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [deprecated](https://wordpress.org/support/topic-tag/deprecated/)
 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception-2/#post-17748478)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
