Heads up: Using local sockets to connect to MySQLat 2012-01-08 in Announcements, Databases by friebe (0 comments) MySQL allows running MySQL servers with disabled networking. This is suggested as security measure if the application and the database server run on the same machine, but in reality we usually don't have this kind of a setup except on the developers' machines. This is where we hit an inconsistency in our userland MySQL driver "mysqlx": It wasn't connecting to the MySQL server on localhost, where the standard MySQL driver was. This has been fixed in the meantime.Some research into this topic revealed the following:
Especially the last part is a bit frustrating, because it's magic, and magic behaviour is never good in software. This is why the XP group has decided to be inconsistent with the MySQL libraries and not support this in mysqlx. Furthermore, we have decided to remove the magic from the standard MySQL driver implementations in order to be consistent. Instead, use the dot (.) as a notation for "this machine", as seen in the following examples: // Connect to the MySQL server on this machine via local sockets.In contrast, this will now always use TCP/IP: $conn= DriverManager::getConnection('mysql://localhost/NEWS'); |
|