用ADO连接MYSQL的连接字符串

How to set up the dbGo (ADO) ConnectionString for mySQL database

From Zarko Gajic,

If your database choice is mySQL and you are using dbGO (ADO) components, over mySQL ODBC 3.51 driver or MySQL Connector/ODBC 5.0, this is how your TADOConnection’s ConnectionString property should look:

  • When using “ODBC 3.51 LOCAL database“:

    ‘DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=myDatabase; USER=myUsername; PASSWORD=myPassword;OPTION=3;’

  • When using “ODBC 3.51 REMOTE database“:

    ‘DRIVER={MySQL ODBC 3.51 Driver}; SERVER=data.domain.com; PORT=3306; DATABASE=myDatabase; USER=myUsername; PASSWORD=myPassword; OPTION=3;’

  • When using “ODBC 5.0 LOCAL database“:

    ‘DRIVER={MySQL Connector/ODBC v5}; SERVER=localhost; DATABASE=myDatabase; UID=myUsername; PASSWORD=myPassword;OPTION=3;’

  • When using “ODBC 5.0 REMOTE database“:

    ‘DRIVER={MySQL Connector/ODBC v5}; SERVER=data.domain.com; PORT=3306; DATABASE=myDatabase; UID=myUsername; PASSWORD=myPassword;OPTION=3;’

Note: “data.domain.com” is the name of the data server, “myDatabase” is the name of the database, “myUsername” is the name of the user, “myPassword” is the password for “myUsername”

发表评论

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据