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;

  • 1 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,...

phpMyAdmin: Restore MySQL database

Please follow the steps below to restore/import your MySQL database:1. Login to your phpMyAdmin...

SolidCP & MSPControl: Create MySQL database

Please follow the steps below to create your MySQL database. * Please replace yourdomain.com...

DirectAdmin: Restore MySQL database

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

phpMyAdmin: Backup MySQL database

Please follow the steps below to backup/export your MySQL Database:1. Login to your phpMyAdmin...