MariaDB 数据库安装与操作
一、数据库安装
- 安装依赖
$ yum install mariadb-embedded mariadb-libs mariadb-bench mariadb mariadb-sever - 安装 MariaDb
yum install mariadb*
注:使用yum install命令安装mysql时,需要多加一个通配符"*"
二、创建用户
CREATE USER ‘username’@‘host’ IDENTIFIED BY ‘password’;
二、用户授权与撤销
GRANT all privileges on db_name.* to ‘username’@’%’;
REVOKE all privilege ON db_name.tablename FROM ‘username’@’%’;
三、修改用户密码
set password for root@localhost=password(‘123456abc’);
四、删除用户
DROP USER ‘username’@‘host’;