Home  >  Article  >  Database  >  mysql-C+++操作MYSQL检查要创建的数据库是否存在

mysql-C+++操作MYSQL检查要创建的数据库是否存在

WBOY
WBOYOriginal
2016-06-06 09:42:311895browse

mysqlc++

C+++操作MYSQL检查要创建的数据库是否存在
若已存在则不创建数据库并断开与数据库的连接
这个该如何实现呢

我之前用的方法是存在数据库就删除此数据库重建 想改进一下
char str[]="drop database if xx exists"
ret=mysql_real_quary(&mysql,str,sizeof(str)-1)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn