snipt

Ctrl+h for KB shortcuts

MySQL

grant user access on database

grant all on dbname.* to username@localhost identified by 'password';
https://snipt.net/embed/6f39d24caaac206d39cda3800b7fbff9/
/raw/6f39d24caaac206d39cda3800b7fbff9/
6f39d24caaac206d39cda3800b7fbff9
mysql
MySQL
1
2019-07-15T20:17:56
True
False
False
/api/public/snipt/34171/
grant-user-access-on-database
<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><span class="k">grant</span> <span class="k">all</span> <span class="k">on</span> <span class="n">dbname</span><span class="p">.</span><span class="o">*</span> <span class="k">to</span> <span class="n">username</span><span class="o">@</span><span class="n">localhost</span> <span class="n">identified</span> <span class="k">by</span> <span class="s1">&#39;password&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
database, mysql

Bash

unzip and import db

gunzip < backup.sql.gz | mysql -u root -p dbname
https://snipt.net/embed/058a54b6f5c6be5b02e1afcede9dbdec/
/raw/058a54b6f5c6be5b02e1afcede9dbdec/
058a54b6f5c6be5b02e1afcede9dbdec
bash
Bash
1
2019-07-11T14:59:55
True
False
False
/api/public/snipt/34170/
unzip-and-import-db
<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>gunzip &lt; backup.sql.gz <span class="p">|</span> mysql -u root -p dbname </span></pre></div> </td></tr></table>
mysql, ssh

Bash

reload apache

service apache2 reload
https://snipt.net/embed/31ffcf43635e27af6690761fd6a786f2/
/raw/31ffcf43635e27af6690761fd6a786f2/
31ffcf43635e27af6690761fd6a786f2
bash
Bash
1
2019-07-12T17:03:31
True
False
False
/api/public/snipt/34169/
reload-apache
<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>service apache2 reload </span></pre></div> </td></tr></table>
apache, reload, server

Bash

flush computer cache

dscacheutil -flushcache
https://snipt.net/embed/462147d9a8d2b1562064c4b45d5b8223/
/raw/462147d9a8d2b1562064c4b45d5b8223/
462147d9a8d2b1562064c4b45d5b8223
bash
Bash
1
2019-07-11T20:28:29
True
False
False
/api/public/snipt/34168/
flush-computer-cache
<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>dscacheutil -flushcache </span></pre></div> </td></tr></table>
cache, flush, local