How I can use mysql in C++?

2019-03-11 06:41发布

I have searched a lot, all I found is a "mysql++" but I don't know how to install it.

I don't have knowledge about libraries in C++!

标签: c++ mysql
3条回答
欢心
2楼-- · 2019-03-11 07:16

Do you already have a running database to access? If so, then mysql++ is straightforward. There's nothing to install; just include the libraries and headers like any other code. There is a simple example here:

http://tangentsoft.net/mysql++/doc/html/userman/tutorial.html#simple

查看更多
一纸荒年 Trace。
3楼-- · 2019-03-11 07:27

Searching google for "c++ mysql tutorial" brings back the following

Developing Database Applications Using MySQL Connector/C++

and A Tiny MySQL++ Tutorial; C++ and MySQL; MySQL++ Example

Which in turn links to... Installing MySQL++; How to install MySQL++ on Linux-CentOS

And looking through the first article I found this Installing MySQL Connector/C++ from Source

They all seem straight forward enough. Although installation processes vary slightly dependant on your operating system.

查看更多
ゆ 、 Hurt°
4楼-- · 2019-03-11 07:28

You need to compile the library for your platform. Visual Studio can be used for Windows. The official web page of mysql++ has a few FAQs.

Once you have the library compiled, you can go through the tutorials from the manual.

查看更多
登录 后发表回答