以下是在CentOS镜像上安装数据库服务的步骤,以MySQL和PostgreSQL为例:
sudo yum update -y
sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
,然后sudo rpm -ivh mysql80-community-release-el7-3.noarch.rpm
sudo yum install mysql-community-server -y
sudo systemctl start mysqld
,sudo systemctl enable mysqld
sudo mysql_secure_installation
sudo yum update -y
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql-server postgresql-contrib
sudo /usr/pgsql-版本号/bin/postgresql-setup initdb
sudo systemctl start postgresql
,sudo systemctl enable postgresql