XE7Datasnap use dbExpress to connect to MySQL database _ MySQL

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.