调用mysql_select_db的返回值总是false

yingge2016 2017-09-19 04:57:30
centos7
	if(!mysql_select_db(mysqlSt,db_name))
{
perror("mysql_select_db error.");
mysql_error(mysqlSt);
return;
}


数据库已经连接。
输出是:
mysql_select_db error.: Success
...全文
361 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
昵称很不好取 2017-09-19
  • 打赏
  • 举报
回复
返回0是表示连接正确吧 mysql_select_db() fails unless the connected user can be authenticated as having permission to use the database. Return Values Zero for success. Nonzero if an error occurred. Errors CR_COMMANDS_OUT_OF_SYNC Commands were executed in an improper order. CR_SERVER_GONE_ERROR The MySQL server has gone away. CR_SERVER_LOST The connection to the server was lost during the query. CR_UNKNOWN_ERROR An unknown error occurred.

23,125

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧