MySQL Locking


in MySQL

After experimenting a bit with MySQL locking today, I thought I’d make a note of what I’d discovered: To create a lock, you need to use: LOCK TABLES table1 [READ |WRITE], table2 [READ |WRITE] READ is used to stop other people … Continue reading

Load CSV data into MySQL


in MySQL

load data local infile ‘export.csv’ into table table_name fields terminated by ‘,’ enclosed by ‘“‘ lines terminated by ‘n’ (field_list)

Useful SQL


in MySQL

update [table_name] set [field_name] = replace([field_name], ‘[string_to_find]’, ‘[string_to_replace]’); Replace within a field

MySQL Log Rotation


in MySQL

Make sure that expire_logs_days is set to ensure that log rotation takes place