MySQL installation directory in the Lib subdirectory of the Libmysql.dll file copy to C:/windows/system32 (the system is not on the C drive to the corresponding directory), restart the Delphi XE, follow the above steps to test the connection, You will see that there is still an issue that does not initialize the database driver correctly. The biggest detour is the use of the installation version of MySQL. You just have to use the decompression version of the MySQL database to be no problem. In fact, the real thing here is still libmysql.dll. as long as you extract the version of Libmysql.dll from the extracted version of MySQL to the C:/windows/system32 directory, there will be no problem of properly initializing the database driver.
For details, refer to the following website
http://blog.csdn.net/chaijunkun/article/details/6266641
Delphi XE2 using dbexpress to connect to MySQL database