DbExpress provides the connection capabilities of multiple databases. this time, we used MySQL as an example to test the connection of MYSQL. Note the following points during the process: 1. create the DataSnap server, there is nothing to say about this. according to the Wizard, the ServerMethodsUnit1 module dbExpress is finally generated to provide the connection capability of multiple databases. this time, we used MySQL as an example to test the connection of MYSQL, notes during the process:
1. there is nothing to say about creating the DataSnap server. according to the Wizard, the ServerMethodsUnit1 module is finally generated,
2. set mysql connection information in Data Explorer. of course, it cannot be connected now.
3. add the TSQLConnect, TSQLTable, and TDataSetProvider components to the ServerMethodsUnit1 module.
4. select ConnectionName as MySQLConnection, Driver as MySQL, fill in the DataBase, HostName, Password, UserName, if the server has character requirements, but also fill in ServerCharSet (usually UTF-8 ).
5. click the Connected attribute of SQLConnect. If an error is reported, it cannot be Connected. if you encounter such a problem, follow the methods below.
Unable to connect:
1. install the mysql server. if the 32bit program is developed, select the 32bit installation package and install libmysql in the bin directory. copy the dll to the system32 directory, or directly put the bin directory into the library of Delphi.
2. find dbxmys. dll in the XE7 installation directory, which should be copied to the Debug Directory of the application in X: \ Embarcadero \ Studio \ 15.0 \ Redist \ win32.
Then click the Connected attribute of SQLConnect again to be True, and the connection is successful.