MariaDB安装
系统
CentOS
安装
yum install mariadb
yum install mariadb-server
启动
sudo systemctl enable mariadb
sudo systemctl start mariadb
安全设置检查
mysql_secure_installation
第一次安装后,运行上面的命令来进行安全性设置。
登录&新建数据库
mysql -u root -p
create database testdb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
create user 'testuser'@localhost identified by 'password';
grant all on testdb.* to 'testuser' identified by 'password';
如果要是新建的数据库用户可以外网访问,需要将 @localhost修改为@'%'