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;

相关文章:

  • 2021-11-16
  • 2021-10-16
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-08-23
猜你喜欢
  • 2021-05-17
  • 2022-12-23
  • 2021-12-13
  • 2021-12-13
  • 2021-09-28
  • 2021-04-04
  • 2022-12-23
相关资源
相似解决方案