当前位置: 技术问答>linux和unix
[求救]linux下连接mysql数据库的问题
来源: 互联网 发布时间:2015-08-23
本文导语: #include #include #include int main() { MYSQL * ptrMibDB = 0; if ((ptrMibDB = mysql_init(ptrMibDB)) && mysql_real_connect(ptrMibDB, "localhost", "root", "123456", "DBname", 3306, 0, 0)) { if (mysql_select_db(ptrMibDB, "localhos...
#include
#include
#include
int main()
{
MYSQL * ptrMibDB = 0;
if ((ptrMibDB = mysql_init(ptrMibDB))
&& mysql_real_connect(ptrMibDB, "localhost", "root", "123456", "DBname", 3306, 0, 0))
{
if (mysql_select_db(ptrMibDB, "localhost")
#include
#include
int main()
{
MYSQL * ptrMibDB = 0;
if ((ptrMibDB = mysql_init(ptrMibDB))
&& mysql_real_connect(ptrMibDB, "localhost", "root", "123456", "DBname", 3306, 0, 0))
{
if (mysql_select_db(ptrMibDB, "localhost")