Skip to content

Instantly share code, notes, and snippets.

@UbuntuEvangelist
Last active February 11, 2022 22:52
Show Gist options
  • Save UbuntuEvangelist/2ad145d276e23ade663f36cbbed067bb to your computer and use it in GitHub Desktop.
Save UbuntuEvangelist/2ad145d276e23ade663f36cbbed067bb to your computer and use it in GitHub Desktop.
Install MySQL on Ubuntu 20.04 [Quickstart]
apt install mysql-server
mysql_secure_installation
mysql --version
service mysql start
service mysql enable
service mysql restart
service mysql status
ufw allow from any to any port 3306 proto tcp
systemctl restart mysql
systemctl enable mysql
nano /etc/mysql/mysql.conf.d/mysqld.cnf
#And then change the bind-address line to 0.0.0.0
# Save and exit
ufw allow from any to any port 3306 proto tcp
sudo systemctl restart mysql
sudo systemctl enable mysql
sudo mysql
CREATE DATABASE formalms;
CREATE USER 'trainee'@'localhost' IDENTIFIED WITH mysql_native_password BY 'D@y-7869';
ALTER USER 'trainee'@'localhost' IDENTIFIED WITH mysql_native_password BY 'D@y-7869';
GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT on *.* TO 'trainee'@'localhost' WITH GRANT OPTION;
use formalms;
FLUSH PRIVILEGES;
exit
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
CREATE DATABASE formalms;
CREATE USER 'netadmin'@'%' IDENTIFIED BY 'N@tDP$786';
GRANT ALL PRIVILEGES ON *.* TO 'netadmin'@'%';
use formalms;
FLUSH PRIVILEGES;
exit
systemctl restart mysql
apt update -y && apt upgrade -y
@UbuntuEvangelist
Copy link
Author

CREATE DATABASE formadb CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'formadmin'@'%' IDENTIFIED BY 'N@tDP$786';
GRANT ALL PRIVILEGES ON . TO 'formadmin'@'%';
use formadb;
FLUSH PRIVILEGES;
exit
systemctl restart mysql
apt update -y && apt upgrade -y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment