sudo dnf install mysql-server
sudo systemctl start mysqld.service
sudo systemctl enable mysqld.service
sudo systemctl status mysqld.service
mysqladmin -u root -p version
wget -c https://repo.mysql.com//mysql80-community-release-sl15-5.noarch.rpm
rpm -ivh mysql80-community-release-sl15-5.noarch.rpm
sudo rpm --import /etc/RPM-GPG-KEY-mysql
sudo zypper ref mysql80-community
sudo zypper install -y mysql-community-server
# root 默认密码 在 /var/log/mysql/mysqld.log
sudo systemctl enable mysql;
sudo systemctl start mysql;
sudo systemctl status mysql;
修改root密码,创建admin用户并允许远程登录,记得服务器防火墙的3306端口要打开
sudo mysql_secure_installation 根据提示修改root密码
mysql -u root -p #输入密码然后登录mysql
mysql> CREATE USER `admin`@`%` IDENTIFIED BY 'password';
mysql> GRANT ALL ON *.* TO `admin`@`%` WITH GRANT OPTION;