For InnoDB engines, copy the IB_LOGFILE0,IB_LOGFILE1,IBDATA1 and database folders in the data directory (only the frm file)
Do not be afraid of the version, MY.CNF set up what problem, although to cold backup good, if you feel large, can be tar compression, compression efficiency scary
For MyISAM engines, copy the database folder under the Data directory (with MYD,MYI,FRM)
Of course it is best to use the CP-PR command, p is the meaning of saving attributes.
Compile and install MySQL to specify the path, you can rest assured that, of course, if you can not compile the sock file and PID files can be specified in my, it is best to backup
Perform PS aux|grep mysql check the sock,pid,log,data path of the original settings
About the link with PHP, now appears to be a problem with PHP, there is no question about MySQL and PHP installation (mysq5.6.23,php5.6), link the way with Mysqlnd
PHP is installed with the source of php56w because it is not important to install in which directory is not related (my service provider only provides weekly backup of the data disk)
PS: Start, PHP can not link on the database, checked for half a day found in the Phpinfo information table MySQL Client API is the old version, not Mysqlnd, after php5.5 provided by default is MYSQLND
Even though the PDO MySQL way doesn't seem to provide
Compile and upgrade some of the issues noted in MySQL such as PHP connection Mysqlnd phpMyAdmin