Keep forgetting this. Replace a string in all rows:
UPDATE <table> SET <column> = REPLACE(<column>, '<string to find>', '<string to replace>');
Keep forgetting this. Replace a string in all rows:
UPDATE <table> SET <column> = REPLACE(<column>, '<string to find>', '<string to replace>');
Because I keep forgetting it: ALTER TABLE the_table AUTO_INCREMENT= 0
Run from mysql program with FILE privileges or it won’t work.
LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3);
Note: Path needs to be absolute