我正在尝试使用此查询将数据从一个列复制到另一个列中的另一个列
REPLACE INTO am_finder_value (dropdown_id, name) SELECT 6, ukyear FROM am_finder_models WHERE ukyear IS NOT NULL AND ukyear <>'';
am_finder_models
+------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| model_id | text | YES | | NULL | |
| modelname | text | YES | | NULL | |
| ukyear | text | YES | | NULL | |
| euroyear | text | YES | | NULL | |
| chassis_id | text | YES | | NULL | |
+------------+---------+------+-----+---------+----------------+
am_finder_value
+-------------+-----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-----------------------+------+-----+---------+----------------+
| value_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| parent_id | int(10) unsigned | NO | MUL | NULL | |
| dropdown_id | mediumint(8) unsigned | NO | MUL | NULL | |
| name | varchar(255) | NO | | NULL | |
+-------------+-----------------------+------+-----+---------+----------------+
我一直在
Lock wait timeout exceeded; try restarting transaction
我已将超时时间增加到300
| Variable_name | Value |
+--------------------------+-------+
| innodb_lock_wait_timeout | 300 |
+--------------------------+-------+
是否有更好的更有效的方法来复制数据?
答案 0 :(得分:0)
使用
SHOW PROCESSLIST;
phpmyadmin
中的这将显示带有id和执行时间的线程 所以你可以杀死那些花费太多时间执行的线程