Page MenuHomePhabricator

Changing mysql.implementation setting doesn't work
Closed, ResolvedPublic


Setting mysql.implementation to AphrontMySQLDatabaseConnection results in an exception, even though it works with AphrontMySQLiDatabaseConnection.

I did this in the shell:

$ bin/config set mysql.implementation AphrontMySQLiDatabaseConnection
Set 'mysql.implementation' in local configuration.
$ bin/config set mysql.implementation AphrontMySQLDatabaseConnection 
Usage Exception: Option 'mysql.implementation' value must name a class extending 'AphrontMySQLDatabaseConnectionBase'.

Version: f75b1cf562c0c3646324864851d693ef1069a068 which is the stable branch from 2016-04-18

Event Timeline

AphrontMySQLDatabaseConnectionBase was renamed but I plan to remove this option anyway.

Why are you trying to use AphrontMySQLDatabaseConnection instead of AphrontMySQLiDatabaseConnection?

It involves dirty solutions to idiosyncratic problems, maybe we're both better off not talking about it.

Haha, alright. You might be able to add it to conf/local/local.json manually as a workaround, but I'm not sure if that'll work or not.

In the future, I plan to automatically select MySQLi if it's available and fall back to MySQL only if it isn't.

That actually works! Thanks :)

I've marked D16909 as fixing this, but it just removes mysql.implementation, and uses the rule "mysqli if available, mysql otherwise".

If you still need to force MySQL in the presence of MySQLi, you'll need to make a one-line adjustment to PhabricatorDatabaseRef::newRawConnection() to force the selection. I believe no compelling / generally reasonable use case exists for this. If anyone has one, we can look at modularizing this.