连接redis数据库日志
连接redis数据库日志
void Redis_Project2::slotOnConnectRedisButtonClick() { db_address_redis = this->lineEdit_address_redis->text(); db_port_redis = this->lineEdit_port_redis->text().toInt(); db_pwd_redis = this->lineEdit_pwd_redis->text(); db_id_redis = this->lineEdit_dbID_redis->text().toInt(); if (redisObj->open(db_address_redis, db_port_redis, 1000)) { if (!redisObj->auth(db_pwd_redis)) { QString errorMsg = redisObj->getErrorInfo(); redisObj->close(); qDebug() << "connect failed " << errorMsg; addRedisText(errorMsg); } else { qDebug() << "connect success..."; addRedisText(QString("connect db").append(QString::number(db_id_redis).append(QString(" success..")))); } } else { QString errorMsg = redisObj->getErrorInfo(); redisObj->close(); qDebug() << "connect failed " << errorMsg; addRedisText(QString("connect failed ").append(errorMsg)); } //加载数据库的所有key slotLoadAllRedisKeys(); }
#######################
QQ 3087438119