Connection strings for MySQL

Connection string is a string that contains information about a data source and means of connection to it.
It is commonly used to connect database to web application.

MySQL Connector/Net
Server=MYSQL_Server_IP;Port=MYSQL_PORT;Database=DATABASE_NAME;Uid=DATABASE_USER;Pwd=DATABASE_USER_PASSWORD;

MySQL Connector/ODBC 3.51
Driver={MySQL ODBC 3.51 Driver};Server=MYSQL_Server_IP;Port=MYSQL_PORT;Database=DATABASE_NAME;User=DATABASE_USER; Password=DATABASE_USER_PASSWORD;Option=3;

MySQL Connector/ODBC 5.1
Driver={MySQL ODBC 5.1 Driver};Server=MYSQL_Server_IP;Port=MYSQL_PORT;Database=DATABASE_NAME;User=DATABASE_USER; Password=DATABASE_USER_PASSWORD;Option=3;

MySQL Connector/ODBC 5.2
For ANSI Records:
Driver={MySQL ODBC 5.2 ANSI Driver};Server=MYSQL_Server_IP;Port=MYSQL_PORT;Database=DATABASE_NAME;User=DATABASE_USER; Password=DATABASE_USER_PASSWORD;Option=3;
For Unicode Records:
Driver={MySQL ODBC 5.2 Unicode Driver};Server=MYSQL_Server_IP;Port=MYSQL_PORT;Database=DATABASE_NAME;User=DATABASE_USER; Password=DATABASE_USER_PASSWORD;Option=3;

MySQL Connector/ODBC 5.3
For ANSI Records:
Driver={MySQL ODBC 5.3 ANSI Driver};Server=MYSQL_Server_IP;Port=MYSQL_PORT;Database=DATABASE_NAME;User=DATABASE_USER; Password=DATABASE_USER_PASSWORD;Option=3;
For Unicode Records:
Driver={MySQL ODBC 5.3 Unicode Driver};Server=MYSQL_Server_IP;Port=MYSQL_PORT;Database=DATABASE_NAME;User=DATABASE_USER; Password=DATABASE_USER_PASSWORD;Option=3;

Sample:
Server=222.222.222.222;Port=3366;Database=MyDatabase;Uid=MyUser;Pwd=MyPassword;

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to manage my MySQL databases?

You can use provided phpMyAdmin to manage your MySQL databases. phpMyAdmin allows you to change,...

DirectAdmin: Creating MySQL database

Please follow the steps below to create MySQL database in DirectAdmin control panel. * Please...

DirectAdmin: Restore MySQL database

Please follow the steps below to restore MySQL database in DirectAdmin control panel. * Please...

cPanel: Create new MySQL database and user

Please follow the steps below to create New User MySQL:1. Login to your hosting control panel...

DirectAdmin: Backup MySQL database

Please follow the steps below to backup MySQL database in DirectAdmin control panel. * Please...