Today, a small problem, is clearly correct PHP code when accessing the database Always prompt db ERROR. Later found to fill in the database name, wrote the database's IP address (in fact, it is also the native IP but this machine is still inaccessible), not localhost.
In the final analysis, the root of the problem is that MySQL does not open remote access, the specific way to open:
D:\wamp\Apache2\conf\alias\phpmyadmin.conf
Found it
Deny from all
Allow from all
Delete these two lines to allow from all
In addition, the MySQL database does not have to be deployed on this machine, and the method of deployment separately is:
In the MySQL database on the machine, through the phpMyAdmin access to the local database, into the MySQL database user table, to find the root record, the host field from localhost to%, in fact, the permission to set any host is the same effect.
Separate deployment and remote access to MySQL database in WAMP integrated environment