Skip to content

Instantly share code, notes, and snippets.

View osoda's full-sized avatar
💻
Developing

osoda osoda

💻
Developing
View GitHub Profile
@osoda
osoda / db-far.php
Last active February 14, 2022 19:09 — forked from KLicheR/db-far.php
PHP script that perform a find and replace in a database dump (tested with MySQL) with adjustments of the PHP serialize founded.
<?php
/**
* PHP script that perform a find and replace in a database dump (tested with
* MySQL) with adjustments of the PHP serialize founded.
*
* Don't forget to escape your "special characters":
* "a$b" -> "a\$b"
* "a"b" -> "a\"b"
* "a`b" -> "a\`b"
@osoda
osoda / dump.sh
Last active November 7, 2018 23:24 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
### (v2)
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## IGNORE THIS BLOCK TO >=(v2)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases