3 ms·
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'waiting for initial communication packet', system error: 95 in /home/zane
by randomdrake 12y ago
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'waiting for initial communication packet', system error: 95 in /home/zane/public_html/airgif/api/engine/mysql.php on line 12
{"error":"Failed to connect to the database: Lost connection to MySQL server at 'waiting for initial communication packet', system error: 95"}
For those of you starting new PHP projects, and for the sake of this one: the mysql_* set of functions in PHP have been discouraged for many years and are deprecated[1] as of PHP 5.5.
Hopefully it isn't too late to migrate to mysqli_*[2] functions or, what many developers prefer, PDO[3]. Should you choose to go the PDO route, there are some good resources out there[4] to get started.
[1] - https://php.net/manual/en/migration55.deprecated.php https://php.net/manual/en/migration55.deprecated.php
[2] - https://php.net/manual/en/book.mysqli.php https://php.net/manual/en/book.mysqli.php
[3] - https://php.net/manual/en/book.pdo.php https://php.net/manual/en/book.pdo.php
[4] - http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers
- ZaneClaes 12y agoThanks for the heads up. I use PHP only to hack together quick side projects... but yet another reason it sucks ;(
- CaveTech 12y agoHow is this PHPs fault? You're using functions that have been recommended against for well over 5 years. If anything, it's a testament to PHP that you've managed to get a web-app up and running when you have so little experience with it.