首先进入mysql bin目录,然后执行以下命令即可。
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.0.31 MySQL Community Server - GPL
Copyright (c) 2000, 2022, 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
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
通过进入MySQL的bin目录,使用mysql-uroot-p命令并输入密码后,成功连接到MySQL服务器。显示了版本信息以及默认的几个数据库,包括information_schema,mysql,performance_schema和sys。
442

被折叠的 条评论
为什么被折叠?



