From 1b973fe56ed08fa406e0412dbea43e6900fff239 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Wed, 19 Apr 2023 16:36:41 -0400 Subject: [PATCH] Update mariadb setup guide --- guides/install-mysql-mariadb.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/guides/install-mysql-mariadb.html b/guides/install-mysql-mariadb.html index c5e64d4..67cdae9 100644 --- a/guides/install-mysql-mariadb.html +++ b/guides/install-mysql-mariadb.html @@ -40,15 +40,20 @@

Secure Install/Setup

sudo mysql_secure_installation
+

Run the above command, and follow the instructions, if you don't want to then follow mine.

+

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.

Create Admin user

sudo mysql
-
GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
+
GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY '<DESIRED_PASSWORD>' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;

Test it works

+

Simply try logging in as the admin account.

+
mysql -u admin -p
+

It should ask for a password, so enter your DESIRED_PASSWORD, and if you get mysql access, it's successful.

(Optional) Make it easier to access on command line

If you're working with a terminal, when calling mysql 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.

@@ -56,9 +61,9 @@
vim ~/.my.cnf

Add the following, with your credentials

[mysql]
-user=
-password=
-

The above can be used for mysqldump, mysqladmin, and others too, by replacing the [mysql] block

+user=<USERNAME> +password=<PASSWORD> +

The above can be used for mysqldump, mysqladmin, and others too, by replacing the [mysql] block, with the related. e.g. [mysqldump].