Redhat 7 之 Mariadb(mysql)

Redhat7 之后mysql 改为Mariadba,由于mysql 被卖给了IBM, 有闭源的风险。

所以就另外开了一个新的分支,继续开源。Maria 来源于mysql开发者的女儿的名字。

 

1. 安装MariaDB

 

yum install -y mariadb mariadb-server

systemctl ebable mariadb

systemctl start mariadb

 

Mariadb简单设置

mysql_secure_installation 第一次进入时直接回车

然后设置好密码

 

2. 登陆

mysql -r root -u password

 

3、添加用户,设置权限

创建用户命令

mysql>create user username@localhost identified by 'password';

直接创建用户并授权的命令

mysql>grant all on *.* to username@localhost indentified by 'password';

授予外网登陆权限 

mysql>grant all privileges on *.* to username@'%' identified by 'password';

授予权限并且可以授权

mysql>grant all privileges on *.* to username@'hostname' identified by 'password' with grant option;

4、刷新权限    

flush privileges;
posted @ 2018-02-24 14:51  jaystarba  阅读(955)  评论(0编辑  收藏  举报