|
delphi连接mysql不用添加DSN(mysql connector odbc 5.1版)
Local database
Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase;User=myUsernameundefinedassword=myPassword;Option=3;
Remote database
Driver={MySQL ODBC 5.1 Driver};Server=myServerAddress;Database=myDataBase;User=myUsernameundefinedassword=myPassword;Option=3;
Specifying TCP/IP port
Driver={MySQL ODBC 5.1 Driver};Server=myServerAddressundefinedort=3306;Database=myDataBase;User=myUsernameundefinedassword=myPassword;Option=3;
Specifying character set
Driver={MySQL ODBC 5.1 Driver};Server=myServerAddress;charset=UTF8;Database=myDataBase;User=myUsernameundefinedassword=myPassword;Option=3;
Specifying socket
This one specifies the Unix socket file or Windows named pipe to connect to. Used only for local client connections.
Driver={MySQL ODBC 5.1 Driver};Server=myServerAddress;Database=myDataBase;User=myUsernameundefinedassword=myPassword;Socket=MySQL;Option=3;
On Windows, the socket variable is the name of the named pipe that is used for local client connections. The default value is MySQL.
On Unix platforms, the socket variable is the name of the socket file that is used for local client connections. The default is /tmp/mysql.sock.
Using SSL
Driver={MySQL ODBC 5.1 Driver};Server=myServerAddress;Database=myDataBase;User=myUsernameundefinedassword=myPassword;sslca=c:/cacert.pem;sslcert=c:/client-cert.pem;sslkey=c:/client-key.pem;sslverify=1;Option=3;
SSLCA specifies the path to a file with a list of trust SSL CAs
SSLCERT specifies the name of the SSL certificate file to use for establishing a secure connection.
SSLKEY specifies the name of the SSL key file to use for establishing a secure connection.
|
|