mysql
December 24, 2019
1:40 PM
sudo apt install mysql-server
sudo mysql_secure_installation
set strength of passwords: STRONG
set root password
remove anonymous users? y
Disallow root login remotely? y
Remove test database and access to it? y
Reload privilege tables now? y
To configure the database I'll use mysql command with -u for user and route and than -p to prompt me for my password
sudo mysql -u root -p 
Enter password:
mysql> create user 'luc'@'%' identified by 'mysqluserNeato69,.'
    -> ;
Query OK, 0 rows affected (0.01 sec)
mysql> create database firstdb
    -> ;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on firstdb.* to 'luc'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> create database wp_gutt
    -> ;
Query OK, 1 row affected (0.01 sec)
mysql> grant all on wp_gutt.* to 'luc'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> use firstdb
Database changed
mysql> create table notes (id int, note text);
Query OK, 0 rows affected (0.02 sec)
If we did need to access it remotely we'd need to add a rule to the firewall to allow access through tcp port 3309. To do that with ufw, we'd write ufw allow 3309/tcp. And optionally specify particular networks or hosts to allow. To manage the database, you can work locally at the mqsql shell or install a tool like php myadmin to provide a web interface. Or you could make use of the remote access capability and use a management client from another system