We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Database Error when swapping MySQL Server

How Do I?

Videsh's avatar
Videsh
2 posts
7 months ago
Videsh's avatar Videsh

Hoping someone could point me in the right direction, I am trying to move our MySQL database to a new host, I exported data and imported on the new server.

I edited the config.php file to point to the new database I get an error:

SQLSTATE[HY000] [2002]

When I check the MySQL logs it is indicating that the login is being denied:

Access denied for user ” (using password: NO)

To me Expression Engine is not passing the password when it is trying to connect to the new database, but I must be missing something.

       
Rob Allen's avatar
Rob Allen
3,102 posts
7 months ago
Rob Allen's avatar Rob Allen

Welcome to the forums!

I would first double check the credentials in your config.php:

  1. Is the hostname correct? (usually “localhost” but your host may need another name)

  2. Are the username and password correct? It’s easy to make a typo. If in doubt try resetting the MySQL password and updating config.php

  3. Check to see if the DB user has permissions to access the database.

       
Videsh's avatar
Videsh
2 posts
7 months ago
Videsh's avatar Videsh

Hi Rob,

Thanks for the response, I have managed to fix this, for anyone else who has this obscure error, I was moving to Azure MySQL Flexible server, you also need to edit system\ee\legacy\database\drivers\mysqli\mysqli_connection.php file. There is a line that references to a certificate, in the Azure portal you will need to download the latest Digicert Global Root Cert and repoint it in the mysqli_connection file.

Videsh

       
MargaretDaw's avatar
MargaretDaw
4 posts
7 months ago
MargaretDaw's avatar MargaretDaw

Thanks for the information in your article.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.