mysql> grant select,insert on sakila.* to 'zl'@'localhost' identified by '123';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> exit
Bye
[root@localhost ~]# mysql -uzl -p123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)

 

相关文章:

  • 2021-09-19
  • 2021-11-14
  • 2022-02-09
  • 2021-09-06
  • 2022-12-23
  • 2021-11-21
  • 2021-08-14
  • 2022-12-23
猜你喜欢
  • 2022-01-16
  • 2021-10-08
  • 2021-08-16
  • 2021-08-07
  • 2021-11-01
  • 2021-08-25
  • 2022-12-23
相关资源
相似解决方案