Centos7 yum安装mariadb

116 阅读1分钟

1 配置yum源安装    yum配置文件 /etc/yum.repos.d

yum install mariadb mariadb-server\

2 修改root用户默认密码

update user set password=password("xxxx") where user="root";  修改root用户密码

flush privileges; 刷新权限,

\

3.开放远程端口权限,在mysql表内执行

创建用户命令

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;

刷新权限\

flush privileges;\

这样就已x就安装完成了,缺乏机器练手的小伙伴们可以去3A服务器看看!