要在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數據庫。您可以開始在該數據庫中創建表格和插入數據。