以下是在CentOS镜像中安装和配置数据库的常见方法:
sudo yum update -ysudo yum install mysql-server -ysudo systemctl start mysqld,sudo systemctl enable mysqldsudo grep 'temporary password' /var/log/mysqld.logsudo mysql_secure_installationmysql -u root -psudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-x86_64/pgdg-redhat-repo-latest.noarch.rpmsudo dnf -qy module disable postgresqlsudo yum install -y postgresql-server postgresql-contribsudo /usr/pgsql-版本号/bin/postgresql-版本号-setup initdbsudo systemctl start postgresql-版本号,sudo systemctl enable postgresql-版本号postgresql.conf和pg_hba.conf设置监听地址等sudo -u postgres psql,然后执行ALTER USER postgres PASSWORD 'your_password';