The following is a sample MySQL connection string:

C# in Depth, 3rd Edition


In this example, the MySqlConnection object is configured to connect to a MySQL server at, with a user name of user and a password of userpassword. The default database for all statements will be the allusers database.