SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.37k stars 472 forks source link

How to create database using soci in mysql? #1149

Closed q2013 closed 1 month ago

q2013 commented 1 month ago

I want to connect to the mysql server with the soci library and use it to create a database.(like 'CREATE DATABASE person;') I find that I have to create a session with 'dbName'. img_v3_02au_e82591b3-e18d-4cd4-a7d7-bb218e1982dg

I can do this without passing dbName so that I can connect to the default database when I call mysql_real_connect(). What should I do next to create a new database and switch to it? Or is there another way? image

vadz commented 1 month ago

I don't think there is another way, you need to be able to connect to "mysql" database.