Dev

Local git 2019.12.02

Define a repo somewhere in your file system with a bare init

mkdir -p /somewhere/repo/test_project
cd /somewhere/repo/test_project
git init --bare

Now create a local folder for your work with init only

MySQL

I tried to resync a slave MySQL after it disconnected from the master. But the binary log was already deleted on master, so the only solution was to restore from the last backup. To avoid lock tables on the master and remember the binary log name and position to put them on the slave configuration, there is a tip to take care of all that : the “- master-data” option in mysqldump.

To import a local CSV file into MySQL, use the syntax below :

LOAD DATA LOW_PRIORITY LOCAL INFILE '/path/tofile.csv'
INTO TABLE database.table
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(`field1`,`field2`,...)

To export a mysql results in CSV format, use the syntax below :

SELECT field1, field2, ...
FROM table
WHERE condition
INTO OUTFILE '/tmp/toto.csv'
FIELDS TERMINATED BY ';'
ENCLOSED BY '"'
LINES TERMINATED BY '\n' ;

Just in case you absolutely have to insert a date in MySQL that does’nt exist, eg 2014-02-30, you can run MySQL server in a special mode that authorizes such dates :