Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-06 09:42:31
Original
1918 people have browsed it

mysqlc++

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template