Update mariadb setup guide

master^2
Nathan Steel 3 years ago
parent 72c8392e70
commit 1b973fe56e

@ -40,15 +40,20 @@
<h2>Secure Install/Setup</h2>
<pre><code>sudo mysql_secure_installation</code></pre>
<p>Run the above command, and follow the instructions, if you don't want to then follow mine.</p>
<p>Press enter for the current password, and again when asked if you want to set a root password. Enter the password, then press enter for everything else.
<h2>Create Admin user</h2>
<pre><code>sudo mysql</code></pre>
<pre><code>GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;</code></pre>
<pre><code>GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY '&lt;DESIRED_PASSWORD&gt;' WITH GRANT OPTION;</code></pre>
<pre><code>FLUSH PRIVILEGES;</code></pre>
<pre><code>exit;</code></pre>
<h2>Test it works</h2>
<p>Simply try logging in as the admin account.</p>
<pre><code>mysql -u admin -p</code></pre>
<p>It should ask for a password, so enter your <strong>DESIRED_PASSWORD</strong>, and if you get mysql access, it's successful.</p>
<h2>(Optional) Make it easier to access on command line</h2>
<p>If you're working with a terminal, when calling <code>mysql</code> you'll need to enter a password each time. You can store the passwordwith a special .cnf file, making it faster to get into writing SQL.</p>
@ -56,9 +61,9 @@
<pre><code>vim ~/.my.cnf</code></pre>
<p>Add the following, with your credentials</p>
<pre><code>[mysql]
user=<USERNAME>
password=<PASSWORD></code></pre>
<p>The above can be used for mysqldump, mysqladmin, and others too, by replacing the <code>[mysql]</code> block</p>
user=&lt;USERNAME&gt;
password=&lt;PASSWORD&gt;</code></pre>
<p>The above can be used for mysqldump, mysqladmin, and others too, by replacing the <code>[mysql]</code> block, with the related. e.g. <code>[mysqldump]</code>.</p>
</section>
</main>

Loading…
Cancel
Save