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
[email protected][~]# sudo apt-get -y install mysql-server mysql-client
Securing MySQL Server
[email protected][~]# 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
[email protected][~]# 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:
[email protected][~]# mysql -u root -p
[email protected][~]# CREATE USER 'stephen'@'localhost' IDENTIFIED BY 'password';
[email protected][~]# CREATE DATABASE snet;
[email protected][~]# GRANT ALL ON snet.* to 'stephen'@'localhost' IDENTIFIED BY 'password';
[email protected][~]# FLUSH PRIVILEGES;
[email protected]et[~]# exit
[email protected][~]# sudo systemctl restart mysql