MySQLi not working - possible solution

If:

You can't get MySQLi to work.

And:

The database credentials you are using were created on an older version of MySQL (not sure how old, but most likely prior to MySQL 5.)

Then:

Your database password may need to be updated to use the newer authentication scheme.

There are instructions on how to do that out there. Here is one example: http://code.openark.org/blog/mysql/upgrading-passwords-from-old_passwords-to-new-passwords

Or, if you're lazy like me, just create a new user and password and assign it to the database. Don't forget to apply the appropriate permissions to the new user. Then use that new user and password for ZenPhoto.

...jim

Comments

  • Thanks for this information. It is not something we were aware of.
  • You're welcome.

    Took me six hours to figure it out. All ZenPhoto setup (on my web host) was saying was that it could not connect to the DB when MySQLi was selected. This bugged me because it worked fine on my WAMP. Could not find any errors logged anywhere on my host. Finally wrote a small test script to just connect to the DB via MySQLi. That's when I got the error message from MySQL concerning the password. The error message was quite explanatory.

    Perhaps ZenPhoto setup could capture the error being returned from the connection attempt and display it?

    Regards,
    ...jim
  • Normally setup would report the error. But I suspect that since there was once a successful install maybe the path it takes omits that part of the reporting. We will take a look.
  • Yes, this occurred during an upgrade/reinstall. Prior to the upgrade/reinstall, the site had been working using MySQL, not MySQLi.

    Regards,
    ...jim
  • Just curious. What was the error message? Of course, obscure any personal information if you post it here. I did find the path, so from now on the message should get displayed.
  • The error message shown in the setup page under "Database credentials in configuration file" was:

    MySQLi reported: MySQLi not connected

    Setup.log showed the same.

    Regards,
    ...jim
  • Tried out the updated db function php files. Setup is now reporting the actual error message returned by MySQL, onscreen and in setup.log.

    Thanks,
    ...jim
Sign In or Register to comment.