mysql 常用命令

一 摘要

本文主要记录下mysql 常用命令

二 环境信息

(一)mysql 版本

Server version: 5.7.32-35 Percona Server (GPL), Release 35, Revision 5688520

Copyright (c) 2009-2020 Percona LLC and/or its affiliates
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

三 常用命令

(一)数据库操作

3.1.1 建库及建用户授权

create database eladmin character set utf8 collate utf8_bin;
create user eladmin identified by '1qaz@WSX';
grant all privileges on eladmin.* to eladmin@'%' identified by '1qaz@WSX' with grant option;
grant all privileges on eladmin.* to eladmin@localhost identified by '1qaz@WSX' with grant option;
flush privileges;

mysql> create database eladmin  character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> create user eladmin identified by '1qaz@WSX';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on eladmin.* to  eladmin@'%' identified by '1qaz@WSX' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> grant all privileges on eladmin.* to eladmin@localhost  identified by '1qaz@WSX' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>

posted on 2021-01-13 11:52  weiwei2021  阅读(61)  评论(0编辑  收藏  举报