要在CentOS7上安装和配置MariaDB数据库,请按照以下步骤操作:
sudo yum update
sudo yum install mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
sudo mysql -u root -p
CREATE DATABASE dbname;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
exit
sudo mysql -u username -p
USE dbname;
现在,您已经成功在CentOS7上安装和配置MariaDB数据库。您可以开始在该数据库中创建表格和插入数据。