以下是CentOS上常见数据库的配置指南:
yum安装,如sudo yum install mysql-community-server。sudo systemctl start mysqld,sudo systemctl enable mysqld。sudo mysql_secure_installation设置root密码等。CREATE DATABASE和CREATE USER等语句。/etc/my.cnf,可设置监听地址、端口等参数。sudo yum install -y postgresql16-server。sudo /usr/pgsql-版本号/bin/postgresql-版本号-setup initdb,然后sudo systemctl start postgresql-版本号并设置开机自启。postgresql.conf和pg_hba.conf文件,设置监听地址、端口、访问权限等。postgres用户,用psql命令创建。