mirror of https://github.com/BOINC/boinc.git
Merge pull request #3672 from BOINC/dpa_db_init
Server programs: try to print error message if can't connect to DB
This commit is contained in:
commit
becc6e2c93
|
@ -85,10 +85,14 @@ int DB_CONN::open(
|
|||
// CLIENT_FOUND_ROWS means that the # of affected rows for an update
|
||||
// is the # matched by the where, rather than the # actually changed
|
||||
//
|
||||
mysql = mysql_real_connect(
|
||||
MYSQL* mysql2 = mysql_real_connect(
|
||||
mysql, host, db_user, dbpassword, db_name, port, 0, CLIENT_FOUND_ROWS
|
||||
);
|
||||
if (mysql == 0) return ERR_DB_CANT_CONNECT;
|
||||
if (mysql2 == 0) {
|
||||
fprintf(stderr, "mysql_real_connect(): %d: %s\n", mysql_errno(mysql), mysql_error(mysql));
|
||||
return ERR_DB_CANT_CONNECT;
|
||||
}
|
||||
mysql = mysql2;
|
||||
|
||||
if (set_opt_after) {
|
||||
bool mbReconnect = 1;
|
||||
|
|
Loading…
Reference in New Issue