如何删除 MySQL 表中 2.5 亿条数据?

为什么会有 2.5 亿条数据

运营需求,需要提供查询用户登录的记录。

我一思索,这简单呀,就设计了如下的数据表。

desc login_record;
+-------------+------------------+------+-----+-------------------+-------+
| Field       | Type             | Null | Key | Default           | Extra |
+-------------+------------------+------+-----+-------------------+-------+
| user_id     | int(10) unsigned | NO   | MUL | NULL              |       |
| ip          | varchar(40)      | YES  |     |                   |       |
| device_mark | varchar(500)     | NO   |     |                   |       |
| time        | timestamp        | NO   | MUL | CURRENT_TIMESTAMP |       |
+-------------+------------------+------+-----+-------------------+-------+
[Read More]
MySQL  Go 

C++ Mysql null 引发的血案

代码

出错代码段

bool CGameServer::getAccountInfoByUserId(int user_id, UserAccountData& data) {                                                                                          
    if (connectToLocalDB()) {
        log_error("connect to db failed");
        return false;
    }

    TLIB_DB_LINK *pTempDBLink = &m_stLDBLink;

    snprintf(pTempDBLink->sQuery[0], sizeof(pTempDBLink->sQuery[0]), 
        "select bind_mark, account, password, state, device_mark, country, tunnel, \
        register_version, transfer_code, bind_equipment from account_data where \
        user_id=%d", user_id);
    //......
                if (pTempDBLink->stRow[i]) {
                    data._transfer_code = pTempDBLink->stRow[i++];
                }

                if (pTempDBLink->stRow[i]) {
                    data._bind_equipment = atoi(pTempDBLink->stRow[i++]);
                }
   //......
[Read More]
C++  MySQL