MYSQL SERVER ON UBUNTU SERVER
MySQL is an open-source relational database management system. RDBMS is a software or service used to create and manage databases based on a relational model. A database is simply a collection of structured data. A database is a place in which data is stored and organized. Source:https://www.hostinger.com/tutorials/what-is-mysql
root@snet[~]# sudo apt-get -y install mysql-server mysql-client
Securing MySQL Server
root@snet[~]# mysql_secure_installation
Enter password for user root: <– Enter the MySQL root password
Change the password for root? (Press y|Y for Yes, any other key for No): <– n
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : <– y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : <– y Reload privilege tables now? (Press y|Y for Yes, any other key for No) : <– y
root@snet[~]# sudo systemctl restart mysql
CREATING OF NEW USER AND DATABASE
Be sure to change stephen to your preferred username and password
to a strong password of your choosing as well as database name snet:
root@snet[~]# mysql -u root -p
root@snet[~]# CREATE USER 'stephen'@'localhost' IDENTIFIED BY 'password';
root@snet[~]# CREATE DATABASE snet;
root@snet[~]# GRANT ALL ON snet.* to 'stephen'@'localhost' IDENTIFIED BY 'password';
root@snet[~]# FLUSH PRIVILEGES;
root@snet[~]# exit
root@snet[~]# sudo systemctl restart mysql