用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"
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。