要在CentOS7上安裝和配置MariaDB數(shù)據(jù)庫,請按照以下步驟操作:
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;
現(xiàn)在,您已經(jīng)成功在CentOS7上安裝和配置MariaDB數(shù)據(jù)庫。您可以開始在該數(shù)據(jù)庫中創(chuàng)建表格和插入數(shù)據(jù)。