HubsInfo Network
Login or Register to remove ads! You're browsing our forum and website as a Guest meaning you can only see a portion of the forum in read-only mode.
PHP MySQL Linux Material Design Web Hosting Online Games SimCity BuildIt

Connect to an external MySQL server with PDO (without delay)


Add one space between mysql: and host (server IP address or dns name)
ex: "mysql: "


Code: [Select]
$conn = new PDO('mysql:host=123.4.5.6;dbname=test_db;port=3306','username','password');
?>

it will fail no matter what. However if you put a space between mysql: and host like this:

$conn = new PDO('mysql: host=123.4.5.6;dbname=test_db;port=3306','username','password');
?>


--
Ref:
http://php.net/manual/ro/pdo.connections.php#118381
http://stackoverflow.com/questions/17630772/pdo-cannot-connect-remote-mysql-server
 



Linux Ubuntu Guides Linux games - Lutris.net