MariaDB常用命令手记

创建用户命令

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;

修改用户密码

update mysql.user set password=PASSWORD('password') WHERE user='username';

刷新系统权限

flush privileges;

创建数据库

create database dbname;

 

posted @ 2016-04-12 20:05  长夏夏夏  阅读(237)  评论(0编辑  收藏  举报