登录
mysql -u 数据库用户名 -p
按回车后,输入密码再按回车,就可以使用mysql命令了
C:\Users\dreams>mysql -u root -p
Enter password: **
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 608
Server version: 8.3.0 MySQL Community Server - GPL
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
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;
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| catbase |
| information_schema |
| mysql |
| performance_schema |
| publiccms |
| sys |
+--------------------+
8 rows in set (0.00 sec)