HubsInfo Network
You're browsing our forum as a Guest meaning you can only see a portion of the forum in read-only mode. To view all forum nodes and be able to create threads/posts please register or log-in.
PHP MySQL Linux Material Design Web Hosting Online Games SimCity BuildIt

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

0 Members and 1 Guest are viewing this topic.

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