Ubuntu环境安装配置Mysql
1)Installation
sudo apt update;sudo apt install mysql-server
2) 设置firewall
sudo ufw enable
sudo ufw allow mysql
3) Start Mysql service
sudo systemctl start mysql
4) Launch after reboot
sudo systemctl enable mysql
5) start mysql shell as the root user
sudo mysql -u root -p
6) Set the root password
For versions earlier than MySQL 5.7:
UPDATE mysql.user SET Password = PASSWORD('password') WHERE User = 'root';
For versions of MySQL 5.7 and later:
UPDATE mysql.user SET authentication_string = PASSWORD('password') WHERE User = 'root';