要在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数据库。您可以开始在该数据库中创建表格和插入数据。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: centos7默认分区是怎么分的