Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
mysql [2008/09/03 18:54] a |
mysql [2009/03/03 19:38] greebo |
||
---|---|---|---|
Line 20: | Line 20: | ||
GRANT ALL PRIVILEGES ON *.* TO myuser@localhost IDENTIFIED BY ' | GRANT ALL PRIVILEGES ON *.* TO myuser@localhost IDENTIFIED BY ' | ||
+ | |||
+ | |||
+ | ==== MySQL: removing duplicate rows from a table ==== | ||
+ | |||
+ | First create a temporary table containing the cleaned-up data: | ||
+ | |||
+ | | ||
+ | |||
+ | and then just delete the original and rename the temporary table: | ||
+ | |||
+ | DROP TABLE original_table; | ||
+ | | ||
Line 74: | Line 86: | ||
If your table is large, then it may take a while to convert it over. There will probably be a fair amount of CPU usage and disk I/O in the process. | If your table is large, then it may take a while to convert it over. There will probably be a fair amount of CPU usage and disk I/O in the process. | ||
- | These statements are also safe in replicated environments. When you issue this statement to the master, it will begin the conversion process. Once it is complete on the master, the statement will roll down to the slaves, and they will begin the conversion as well. Keep in mind, however, that this can greatly reduce the performance of your configuration in the process. | + | These statements are also safe in replicated environments. When you issue this statement to the master, it will begin the conversion process. Once it is complete on the master, the statement will roll down to the slaves, and they will begin the conversion as well. Keep in mind, however, that this can greatly reduce the performance of your configuration in the process.\\ |
+ | |||
+ | \\ | ||
+ | <code bash> | ||
+ | $ rm $HOME/ | ||
+ | $ ln -s /dev/null $HOME/ | ||
+ | \\ | ||
+ | </ |