snipt

Ctrl+h for KB shortcuts

Bash

Creacion usuario mysql

GRANT ALL PRIVILEGES ON test.* TO 'user'@'localhost' IDENTIFIED BY 'pass_user';
https://snipt.net/embed/d4caaa72a0717d613bc94ec317685736/
https://snipt.net/raw/d4caaa72a0717d613bc94ec317685736/
d4caaa72a0717d613bc94ec317685736
bash
Bash
6
2016-09-26T05:16:56
True
False
False
/api/public/snipt/38168/
creacion-usuario-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 id="L-1"><a name="L-1"></a>GRANT ALL PRIVILEGES ON test.* TO <span class="s1">&#39;user&#39;</span>@<span class="s1">&#39;localhost&#39;</span> IDENTIFIED BY <span class="s1">&#39;pass_user&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
create, grant, mysql, user

MySQL

mysql create table script

1
2
3
4
5
6
DROP TABLE IF EXISTS news;
CREATE TABLE news(
	id INT NOT NULL AUTO_INCREMENT,
	date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (id)
);
https://snipt.net/embed/3fcbf8cfda1a27d3ad7a6cc7c556064b/
https://snipt.net/raw/3fcbf8cfda1a27d3ad7a6cc7c556064b/
3fcbf8cfda1a27d3ad7a6cc7c556064b
mysql
MySQL
6
2016-09-22T04:07:10
True
False
False
/api/public/snipt/7519/
mysql-create-table-script
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">DROP</span> <span class="k">TABLE</span> <span class="k">IF</span> <span class="k">EXISTS</span> <span class="n">news</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="nf">news</span><span class="p">(</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">id</span> <span class="kt">INT</span> <span class="k">NOT</span> <span class="no">NULL</span> <span class="kp">AUTO_INCREMENT</span><span class="p">,</span> </span><span id="L-4"><a name="L-4"></a> <span class="kt">date</span> <span class="kt">TIMESTAMP</span> <span class="k">DEFAULT</span> <span class="k">CURRENT_TIMESTAMP</span> <span class="k">ON</span> <span class="k">UPDATE</span> <span class="k">CURRENT_TIMESTAMP</span><span class="p">,</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="n">id</span><span class="p">)</span> </span><span id="L-6"><a name="L-6"></a><span class="p">);</span> </span></pre></div> </td></tr></table>
create, mysql

Bash

create mysql schema

mysqladmin -h <hostname> -u root -p create <schema_name>
https://snipt.net/embed/1d27c30542d8a4e037dae0d2c09c18e8/
https://snipt.net/raw/1d27c30542d8a4e037dae0d2c09c18e8/
1d27c30542d8a4e037dae0d2c09c18e8
bash
Bash
1
2016-09-25T21:39:49
True
False
False
/api/public/snipt/6417/
create-mysql-schema
<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 id="L-1"><a name="L-1"></a>mysqladmin -h &lt;hostname&gt; -u root -p create &lt;schema_name&gt; </span></pre></div> </td></tr></table>
bash, create, database, mysql, schema

MySQL

create mysql user

CREATE USER <username> IDENTIFIED BY '<password>';
CREATE USER <username> IDENTIFIED BY PASSWORD '<crypted password>';
https://snipt.net/embed/d20f1343d435cf94490c51983878f1ae/
https://snipt.net/raw/d20f1343d435cf94490c51983878f1ae/
d20f1343d435cf94490c51983878f1ae
mysql
MySQL
2
2016-09-25T21:40:02
True
False
False
/api/public/snipt/6414/
create-mysql-user-10
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">CREATE</span> <span class="n">USER</span> <span class="o">&lt;</span><span class="n">username</span><span class="o">&gt;</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="s1">&#39;&lt;password&gt;&#39;</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="k">CREATE</span> <span class="n">USER</span> <span class="o">&lt;</span><span class="n">username</span><span class="o">&gt;</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="n">PASSWORD</span> <span class="s1">&#39;&lt;crypted password&gt;&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
create, mysql, user

Bash

create 10mb file -- /dev/random/ is more realistic

dd if=/dev/random of=10mb.file bs=1000k count=10
dd if=/dev/zero of=10mb.file bs=1000k count=10
https://snipt.net/embed/a179c96cd85883b7f3a8a27c09ea69cc/
https://snipt.net/raw/a179c96cd85883b7f3a8a27c09ea69cc/
a179c96cd85883b7f3a8a27c09ea69cc
bash
Bash
2
2016-09-25T17:32:52
True
False
False
/api/public/snipt/5973/
create-10mb-file
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>dd <span class="k">if</span><span class="o">=</span>/dev/random <span class="nv">of</span><span class="o">=</span>10mb.file <span class="nv">bs</span><span class="o">=</span>1000k <span class="nv">count</span><span class="o">=</span>10 </span><span id="L-2"><a name="L-2"></a>dd <span class="k">if</span><span class="o">=</span>/dev/zero <span class="nv">of</span><span class="o">=</span>10mb.file <span class="nv">bs</span><span class="o">=</span>1000k <span class="nv">count</span><span class="o">=</span>10 </span></pre></div> </td></tr></table>
create, file, test
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.