From ae5b18336133997c1930281edc1a897e26c7e1a5 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 30 Dec 2021 13:45:22 +0100 Subject: innodb --- topics/systems/mariadb/move-to-innodb.gmi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'topics/systems/mariadb/move-to-innodb.gmi') diff --git a/topics/systems/mariadb/move-to-innodb.gmi b/topics/systems/mariadb/move-to-innodb.gmi index f5011cb..82540d4 100644 --- a/topics/systems/mariadb/move-to-innodb.gmi +++ b/topics/systems/mariadb/move-to-innodb.gmi @@ -340,6 +340,7 @@ It took your browser 2.119 second(s) to render this page and it shows practically the same results. + ## Table template Prototocol from @@ -353,6 +354,27 @@ Every table update has to follow the template: * [ ] ascertain there is a backup * [ ] copy original files +### Make temporary table + +If you have enough space, you can create a copy of the actual table and do the work on that: + +``` +CREATE TABLE new_tbl [AS] SELECT * FROM MYTABLE; +``` + +Then you can change the column as desired: + +``` +ALTER TABLE tbl_name MODIFY COLUMN col_name BIGINT AUTO_INCREMENT; +``` + +Once the process is done, you can rename the tables: + +``` +DROP MYTABLE; +RENAME TABLE tbl_name TO new_tbl_name, tbl_name2 TO MYTABLE; +``` + ### Check table structure ``` -- cgit v1.2.3