connect to mysql using c++
is it possible to connect to an mysql database and issue queries using c++?
i found some sample code from the internet but they all use mysql! so u need to install mysql first on the computer. what i want 开发者_StackOverflow中文版is to use a program from different locations where i don't have mysql installed to access a remote mysql database. is this possible?Warren Young has made a C++ library call Mysql++ you can find more info at: Mysql++
You could also take a look at: libmysql
You need mysql client libraries. You don't have to have mysql server installed. Details depend on your environment/packaging/etc.
Try libmysql
. You would probably need to write your own C++ wrapper for libmysql
calls but it's worth it. And, yes, you don't need to have local server installed.
I'm using MySQL Connector C++ to connect to a database. This is on Windows XP and Vista. I'm using it with Visual Studio 2008.
Your program creates a connection by specifying the URL to the computer where the database resides. Thus many instances of the application can access a remote database.
精彩评论