Tags Archives: mysql

Search + Replace, Append, Prepend MySQL

Search and replace update [table_name] set [field_name] = replace([field_name],'[string_to_find]’,'[string_to_replace]’); Append update [table_name] set [field_name] = concat([field_name],'[string_to_append]’); Prepend update [table_name] set [field_name] = concat(‘[string_to_prepend]’,[field_name]);

Categories: Uncategorized. Comments Off on Search + Replace, Append, Prepend MySQL

MySQL: How To Repair & Optimize All Tables in All Databases

The following command can be used to repair and optimize all tables in a MySQL database.  This can be useful on a busy server with many tables after a hard reboot or otherwise unclean shutdown. mysqlcheck -u root -p –auto-repair –optimize –all-databases