Dump a mysql database to a plaintext (CSV) backup from the command line

If you can cope with table-at-a-time, and your data is not binary, use the -B option to the mysql command. With this option it’ll generate TSV (tab separated) files which can import into Excel, etc, quite easily: % echo ‘SELECT * FROM table’ | mysql -B -uxxx -pyyy database Alternatively, if you’ve got direct access … Read more

How do you organise multiple git repositories, so that all of them are backed up together?

I would strongly advise against putting unrelated data in a given Git repository. The overhead of creating new repositories is quite low, and that is a feature that makes it possible to keep different lineages completely separate. Fighting that idea means ending up with unnecessarily tangled history, which renders administration more difficult and–more importantly–“archeology” tools … Read more

Creating a shadow copy using the “Backup” context in a PowerShell

Okay, Technoob1984 here with the scoop. See my attached screen shot. This one is tricky, because you have to use x64 version of Powershell (located under system32 not wow64) The Shadow Copy Context are the .properties of the object. Also I used the static method in my screenshots below. https://learn.microsoft.com/en-us/previous-versions/windows/desktop/vsswmi/create-method-in-class-win32-shadowcopy # get existing shadow copies … Read more

What is a simple command line program or script to backup SQL server databases?

To backup a single database from the command line, use osql or sqlcmd. “C:\Program Files\Microsoft SQL Server\90\Tools\Binn\osql.exe” -E -Q “BACKUP DATABASE mydatabase TO DISK=’C:\tmp\db.bak’ WITH FORMAT” You’ll also want to read the documentation on BACKUP and RESTORE and general procedures.

Find files and tar them (with spaces)

Use this: find . -type f -print0 | tar -czvf backup.tar.gz –null -T – It will: deal with files with spaces, newlines, leading dashes, and other funniness handle an unlimited number of files won’t repeatedly overwrite your backup.tar.gz like using tar -c with xargs will do when you have a large number of files Also … Read more

How to backup sqlite database?

The sqlite3 command line tool features the .backup dot command. You can connect to your database with: sqlite3 my_database.sq3 and run the backup dot command with: .backup backup_file.sq3 Instead of the interactive connection to the database, you can also do the backup and close the connection afterwards with sqlite3 my_database.sq3 “.backup ‘backup_file.sq3′” Either way the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)