I am trying to install CiviCRM on Azure using the Wordpress for Linux web app and it appears CiviCRM is failing to find the MYSQL server. I've checked many times to see if the database information, including the MYSQL server information, inputted is correct and it's correct. I've even tried variations of the MYSQL server name, including using port numbers at the end, but it's had no impact.

enter image description here

I tried to install previous versions of CiviCRM to see if that would help, but the same error continues to show up. A similar question came up a few months ago, but I did not see a clear answer on how to resolve the problem.

Your database settings don't appear to be correct. All green, but still error!

I am wondering if this is a bug with CiviCRM that is specific to Azure or if it's something on Azure's side of things. I don't think it's on the Azure side of things because I can install Wordpress and use MYSQL bench with no issue using the same database information.

1 Answer 1


It looks like at the present time you will need to make a small hack to get the installer to be happy. The "does the server exist check" does NOT use the username/password and merely tries to connect as anonymous (https://github.com/civicrm/civicrm-core/blob/5.16.2/install/index.php#L1038). On azure this returns an error 9002, as opposed to the usual 1045 which gets skipped by the next line.

So you should be able to temporarily change that line to

$conn = $this->connect($server, 'username@com1group-mysqldbserver.mysql.database.azure.com', 'your password');

and then after install you can change it back. I don't have an azure database to test if that is sufficient, but just doing a command line test it returns the usual error 1045 so should work.

  • Not sure I understand the downvote? I saw that azure returns a different error code than usual when passed nulls, verified that if you pass it a proper username and a non-null password it returns the same error code as for other mysql systems when those are passed nulls, and then suggested something to test for the poster to verify on a real setup which I don't have. Is it the word "hack"? If I use the word "change" instead would that be preferred?
    – Demerit
    Aug 23, 2019 at 12:39
  • I didn't downvote you. I tried to give you an upvote because I appreciate your efforts in trying to figure out what's going on. Given my low reputation for being new, you might not see it publicly. I passed along what you wrote to Azure Customer support.
    – com1tech
    Aug 23, 2019 at 16:26
  • Ok thanks. It's not a problem with azure it needs to be fixed in civicrm, but it would be good to test "the hack" works first.
    – Demerit
    Aug 23, 2019 at 16:30
  • I tried to test the change to the code. Unfortunately, it didn't work. Instead of seeing the installer page, I got a "The site is experiencing technical difficulties" message when trying to access the installer page.
    – com1tech
    Aug 23, 2019 at 18:18
  • Oops, I forgot to put the ' ' around the data. I'm trying the change again
    – com1tech
    Aug 23, 2019 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.