I've been trying to install the lastest version, 5.9.1, on a new WordPress 5.0.3 site. Requirement checks all passed but when I clicked "Check Requirements and Install CiviCRM" button I got this error:

Cannot open mysql://username:password@localhost:3306/database_name?new_link=true: DB Error: connect failed

Server is using PHP 7.0.27.

Can anyone point me to the right path?

Thanks so much!

2 Answers 2


First, thank you, Demerit, for helping me. I found a patch for the fatal error and it went away. However, the installation error remained.

At the end, turns out this error was due to MySQL password containing special characters. Once the password was changed, I was able to install without any errors. Hope this helps someone else.


It looks like you're using the "mysql" database connector which was removed in php 7.0. Try "mysqli" instead.

  • Hi Demerit. Thanks so much for your suggestions. Could you please tell me how to have the install use mysqli instead? Thanks again!
    – j007w
    Commented Jan 29, 2019 at 19:32
  • I followed the instructions in this page (civicrm.org/blog/totten/psa-please-verify-php-extension-mysqli) and got the "loaded" response. Is there something I need to do to direct the installer to use mysqli?
    – j007w
    Commented Jan 29, 2019 at 19:45
  • Do you by any chance have an environment variable DB_DSN_MODE set? From what I can see the installer should automatically pick mysqli if it's available (as you've tested), but if you have DB_DSN_MODE set, and it's set to something other than "auto" it might not pick it. Also can you check did it actually create the new civicrm database? Also I assume username and password are something you typed above just to hide the real ones, and you're actually using the real ones on the install screen.
    – Demerit
    Commented Jan 29, 2019 at 20:50
  • Hi Demerit. I have no idea how to check the environment variable DB_DSN_MODE. I checked the installer page but it's not there. Did a Google search but that didn't help. Is this part of CiviCRM or PHP/MySQL? I manually created the CiviCRM prior to installation attempt, and you're correct that I entered the real username/pw during these attempts. Thanks again.
    – j007w
    Commented Jan 29, 2019 at 21:16
  • 1
    Thanks, Demerit. I appreciate you. I was researching more into this and found this Apache error right after pressing the install button: PHP Fatal error: Can't use function return value in write context in /wp-content/plugins/civicrm/civicrm.php on line 342. This is the function that starts on line 342: if ( empty( session_id() ) && ! ( defined( 'WP_CLI' ) && WP_CLI ) ) { session_start(); }. What'd you think this means? Thanks again!
    – j007w
    Commented Jan 30, 2019 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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