我的调用代码如下
bool suc = conn.connect("mydb", "localhost", "root", "");
if (suc)
{
cout << "success" << endl;
}
else
{
cout << "fail " << conn.error() << endl;
}并且mysql服务器正在运行,但程序失败,报告无法通过套接字'/tmp/mysql.sock‘连接到本地MySQL服务器(111)
有没有人遇到过这样的问题?
发布于 2012-06-10 06:21:45
Mysql配置文件可能位于/etc/my.cnf
如果Mysql正在运行,查看日志可能会有所帮助,它应该位于/var/ log /中
命名方式类似于:
mysql.log
mysql.err
mysqld.log
mysqld.err
$ ls -l /var/log/
// when you have the name try
$ tail -n 50 /var/log/LogNamehttps://stackoverflow.com/questions/10239678
复制相似问题