“命令行验证MySQL的隔离级别”的版本间的差异

来自姬鸿昌的知识库
跳到导航 跳到搜索
第10行: 第10行:
 
#登录tom:<syntaxhighlight lang="powershell">
 
#登录tom:<syntaxhighlight lang="powershell">
 
C:\Users\Administrator>mysql -utom -pabc123
 
C:\Users\Administrator>mysql -utom -pabc123
 +
</syntaxhighlight>
 +
#查看 root 用户可以操作的数据库:<syntaxhighlight lang="powershell">
 +
mysql> show databases;
 +
+--------------------+
 +
| Database          |
 +
+--------------------+
 +
| information_schema |
 +
| db2019            |
 +
| guns              |
 +
| jdbc_test          |
 +
| ke                |
 +
| m3u8_download      |
 +
| mysql              |
 +
| nacos_config      |
 +
| performance_schema |
 +
| sakila            |
 +
| seata              |
 +
| seata_account      |
 +
| seata_order        |
 +
| seata_storage      |
 +
| sql                |
 +
| sys                |
 +
| world              |
 +
+--------------------+
 +
17 rows in set (0.00 sec)
 +
</syntaxhighlight>
 +
#查看 tom 用户可以操作的数据库:<syntaxhighlight lang="powershell">
 +
mysql> show databases;
 +
+--------------------+
 +
| Database          |
 +
+--------------------+
 +
| information_schema |
 +
+--------------------+
 +
1 row in set (0.00 sec)
 
</syntaxhighlight>
 
</syntaxhighlight>

2023年1月6日 (五) 14:02的版本

https://www.bilibili.com/video/BV1eJ411c7rf?p=40

  1. Windows 下 cmd 进入命令行:
    C:\Users\Administrator>mysql -uroot -p123456
    
  2. 创建一个新用户登录MySQL Server:
    mysql> create user tom identified by 'abc123';
    Query OK, 0 rows affected (0.03 sec)
    
    用户名:tom 密码:abc123
  3. 登录tom:
    C:\Users\Administrator>mysql -utom -pabc123
    
  4. 查看 root 用户可以操作的数据库:
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | db2019             |
    | guns               |
    | jdbc_test          |
    | ke                 |
    | m3u8_download      |
    | mysql              |
    | nacos_config       |
    | performance_schema |
    | sakila             |
    | seata              |
    | seata_account      |
    | seata_order        |
    | seata_storage      |
    | sql                |
    | sys                |
    | world              |
    +--------------------+
    17 rows in set (0.00 sec)
    
  5. 查看 tom 用户可以操作的数据库:
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    +--------------------+
    1 row in set (0.00 sec)