snipt

Ctrl+h for KB shortcuts

Bash

backup all databases mysql

mysqldump --opt --extended-insert --single-transaction --create-options --default-character-set=utf8 --all-databases --user=<user> --password=<password> > all.sql
https://snipt.net/embed/2b620a12190a51ef2778c379b44721d1/
/raw/2b620a12190a51ef2778c379b44721d1/
2b620a12190a51ef2778c379b44721d1
bash
Bash
1
2019-05-24T16:49:16
True
False
False
/api/public/snipt/4914/
backup-all-databases-mysql
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>mysqldump --opt --extended-insert --single-transaction --create-options --default-character-set<span class="o">=</span>utf8 --all-databases --user<span class="o">=</span>&lt;user&gt; --password<span class="o">=</span>&lt;password&gt; &gt; all.sql </span></pre></div> </td></tr></table>
backup, mysql, sysadmin

Bash

simple packet filtering on local host

tcpdump -A -i lo0 port 8080
https://snipt.net/embed/391e44ef7303505434c875f8dce9e54b/
/raw/391e44ef7303505434c875f8dce9e54b/
391e44ef7303505434c875f8dce9e54b
bash
Bash
1
2019-05-13T09:35:18
True
False
False
/api/public/snipt/4102/
simple-packet-filtering-on-local-host
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>tcpdump -A -i lo0 port 8080 </span></pre></div> </td></tr></table>
sysadmin, tcpdump

Bash

mysql: check all tables in all databases

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
https://snipt.net/embed/6d4279ae5b219885f32e6eee51071999/
/raw/6d4279ae5b219885f32e6eee51071999/
6d4279ae5b219885f32e6eee51071999
bash
Bash
1
2019-05-24T17:10:47
True
False
False
/api/public/snipt/2043/
mysql-check-all-tables-in-all-databases
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>mysqlcheck -u root -p --auto-repair --check --optimize --all-databases </span></pre></div> </td></tr></table>
dba, mysql, sysadmin