note 112656 added to mysqli.quickstart.dual-interface
| From: | Anonymous | Date: | Tue, 09 Jul 2013 17:27:00 +0000 |
| Subject: | note 112656 added to mysqli.quickstart.dual-interface | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195550@lists.php.net to get a copy of this message | ||
After significant searching with no success finding a solution I was able to figure out the
following to error 2005 where the connection could not find the host. While I am hosted on 1&1 I
saw numerous posts with similar problems.
The solution turned out to be as follows:
<?php
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT, DB_UNIX_SOCKET);
I added the DB_PORT and DB_UNIX_SOCKET
/** name of the database. please note: database and database table are not the same thing! */
define("DB_NAME", "YOUR DB NAME");
/** user for your database. the user needs to have rights for SELECT, UPDATE, DELETE and INSERT.
/** By the way, it's bad style to use "root", but for development it will work */
define("DB_USER", "YOUR DB USER");
/** The password of the above user */
define("DB_PASS", "YOUR DB PWORD");
/** The unix socket for 1&1 dedicated */
define("DB_UNIX_SOCKET", "/tmp/mysql5.sock");
/** The db port, replace with yours */
define("DB_PORT", 3306);
?>
----
Server IP: 69.147.83.199
Probable Submitter: 209.26.208.254
----
Manual Page -- http://php.net/manual/en/mysqli.quickstart.dual-interface.php
Edit -- https://master.php.net/note/edit/112656
Del: integrated -- https://master.php.net/note/delete/112656/integrated
Del: useless -- https://master.php.net/note/delete/112656/useless
Del: bad code -- https://master.php.net/note/delete/112656/bad+code
Del: spam -- https://master.php.net/note/delete/112656/spam
Del: non-english -- https://master.php.net/note/delete/112656/non-english
Del: in docs -- https://master.php.net/note/delete/112656/in+docs
Del: other reasons-- https://master.php.net/note/delete/112656
Reject -- https://master.php.net/note/reject/112656
Search -- https://master.php.net/manage/user-notes.php