I was looking at some php code and noticed that the mysql interface has
been marked deprecated in favor of the mysqli interface. In
experimenting, I couldn't get php to connect to mysql.
My php build includes '--with-mysqli' '--with-pdo-mysql=mysqlnd'
I was using the command:
$mysqli = new mysqli("localhost", "", "", "test" );
After some research, I found the following did work:
$mysqli = new mysqli("127.0.0.1", "", "", "test");
However, I'd prefer to use UNIX sockets to a TCP connection. With a
little more research, I found that the /etc/php.ini needed to specify
the mysql socket:
[MySQLi]
...
mysqli.default_socket = /run/mysql/mysql.sock
I think this can be set automatically if specified in the php configure
command: --with-mysql-sock=/run/mysql/mysql.sock
But I have not tested that.
I notice that mysql_version.h defines MYSQL_UNIX_ADDR as
"/var/run/mysql/mysql.sock" and that exists because /var/run is a
symlink to /run, but it doesn't seem to be picked up by php, at least as
far as mysqli is concerned.
-- Bruce
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page