Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mysql:snippets [2016-02-09 16:27] – created adminmysql:snippets [2023-10-26 20:04] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ==== MySQL Snippets ==== ==== MySQL Snippets ====
 === Character Sets === === Character Sets ===
-  * Change to UTF-8 +  * Change to UTF-8 (use utf8mb4 to include latest emoticons) 
-    * ''ALTER TABLE XX CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci''+    * ''ALTER TABLE xx CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'' 
 +=== Table manipulation === 
 +  * Duplicate rows 
 +    * ''CREATE TEMPORARY TABLE tmp SELECT * FROM table WHERE column = X;'' 
 +    * ''UPDATE tmp SET column=YY, autoincr_column=NULL;'' 
 +    * ''INSERT INTO table SELECT * FROM tmp;''