MySQL数据库的常用命令

1.创建数据库指定字符集:

CREATE DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

 2.新建用户:

create user 'hive'@'localhost' identified by '123456';

如果提示:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables错误

输入:flush privileges;  //直译:更新权限   即可解决

 3.查询mysql现有用户

 select host,user,authentication_string from mysql.user;

4.给新用户授权

grant all privileges on `hive`.* to 'hive'@'localhost'; 

5.更新权限

grant all privileges on `hive`.* to 'hive'@'localhost';
flush privileges;

6.查看用户权限

show grants for 'xxx'@'localhost';

7.linux备份+windos还原

 

 

 

 

 

 

持续更新...

posted @ 2019-12-15 20:58  东耳听风  阅读(245)  评论(0编辑  收藏  举报