Export mysql data to a tab-separated file
# mysqldump -u root -p –no-create-info -T=/tmp –fields-terminated-by=’\t’ db tabell
A chronological documentation test project, nothing serious, really!
# mysqldump -u root -p –no-create-info -T=/tmp –fields-terminated-by=’\t’ db tabell
# mysqldump -h host.com -u root -p password sourceDB | mysql -h host2.com -u username -p password -C targetDB Interestingly, you don’t actually have be on the ‘source’ machine thanks to mySQL’s -h switch. From the target machine, simply specify the remote host after the -h. This was quite useful for me as my source […]
This is an example on how you an use stored triggers in mySQL /* test_workaround.sql */ USE test ; DROP TABLE IF EXISTS `addresses`; CREATE TABLE `addresses` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `created_on` DATETIME NOT NULL DEFAULT ‘0000-00-00 00:00:00’, `updated_on` DATETIME NOT NULL DEFAULT ‘0000-00-00 00:00:00′, `mac_address` CHAR(17) NOT NULL DEFAULT ’00:16:DD:xx:xx:xx’, /* […]
UPDATE ´tablename´ set field = replace(field, ’searchString’, ‘replaceString’);