Answered by:
Mysql Local Database Connection String

Question
-
Hi,
I would like to create a local database on the users pc using mysql. I have got the temporary folder location using Path.GetTempPath(), I would now like to create a database in the temporary path location my connection string looks like this so far which isn't correct string mysqlConnString = "DRIVER={MySQL ODBC 6.9.8.0 Driver}; SERVER=localhost; UID=''; PASSWORD='';"; How do I do this?
Tuesday, August 30, 2016 8:10 AM
Answers
-
Hi,
mysql is a database which you have to configure. The location for databases is configured inside the my.cnf file. Please see the mysql documentation for details. (http://dev.mysql.com/doc/refman/5.7/en/option-files.html)
So if you want to have mysql on the users PC, then simply install it correctly to use it afterwards. But it is quite common to not set up a full database server for a local application of the user. A common approach there is to use databases that either run inside your own application (e.g. SQLite or SQL Server CE) or that support these scenarios directly (e.g. localdb or auto attach of SQL Server Express).
With kind regards,
Konrad
Edit: mysql related questions should even be asked inside a mysql forum of course.- Edited by Konrad Neitzel Tuesday, August 30, 2016 9:20 AM
- Proposed as answer by Edward8520Microsoft contingent staff Wednesday, August 31, 2016 7:38 AM
- Marked as answer by Herro wongMicrosoft contingent staff Wednesday, September 7, 2016 4:07 AM
Tuesday, August 30, 2016 9:19 AM -
> "I would like to create a local database on the users pc using mysql"
Unlike Access, a MySQL database is made up of many files, all of which are managed by a MySQL instance which must be installed and configured on the machine where the database resides. You cannot just create a file and call it a MySQL database.
Regards, Phill W.
- Proposed as answer by Edward8520Microsoft contingent staff Wednesday, August 31, 2016 7:38 AM
- Marked as answer by Herro wongMicrosoft contingent staff Wednesday, September 7, 2016 4:07 AM
Tuesday, August 30, 2016 11:36 AM
All replies
-
Hi,
mysql is a database which you have to configure. The location for databases is configured inside the my.cnf file. Please see the mysql documentation for details. (http://dev.mysql.com/doc/refman/5.7/en/option-files.html)
So if you want to have mysql on the users PC, then simply install it correctly to use it afterwards. But it is quite common to not set up a full database server for a local application of the user. A common approach there is to use databases that either run inside your own application (e.g. SQLite or SQL Server CE) or that support these scenarios directly (e.g. localdb or auto attach of SQL Server Express).
With kind regards,
Konrad
Edit: mysql related questions should even be asked inside a mysql forum of course.- Edited by Konrad Neitzel Tuesday, August 30, 2016 9:20 AM
- Proposed as answer by Edward8520Microsoft contingent staff Wednesday, August 31, 2016 7:38 AM
- Marked as answer by Herro wongMicrosoft contingent staff Wednesday, September 7, 2016 4:07 AM
Tuesday, August 30, 2016 9:19 AM -
> "I would like to create a local database on the users pc using mysql"
Unlike Access, a MySQL database is made up of many files, all of which are managed by a MySQL instance which must be installed and configured on the machine where the database resides. You cannot just create a file and call it a MySQL database.
Regards, Phill W.
- Proposed as answer by Edward8520Microsoft contingent staff Wednesday, August 31, 2016 7:38 AM
- Marked as answer by Herro wongMicrosoft contingent staff Wednesday, September 7, 2016 4:07 AM
Tuesday, August 30, 2016 11:36 AM