顾流 2021-03-11 19:59 采纳率: 0%
浏览 37

数据库一直这样显示是为什么?

Microsoft Windows [版本 10.0.18363.1379]
(c) 2019 Microsoft Corporation。保留所有权利。

C:\WINDOWS\system32>cd C:\Users\Lenovo\Desktop

C:\Users\Lenovo\Desktop>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 8.0.17 MySQL Community Server - GPL

Copyright (c) 2000, 2019, 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> source example.sql
ERROR:
Failed to open file 'example.sql', error: 2
mysql> source example.sql
ERROR:
Failed to open file 'example.sql', error: 2
mysql> source example.sql;
ERROR:
Failed to open file 'example.sql', error: 2

  • 写回答

2条回答 默认 最新

  • CSDN问答专家001 2021-03-11 21:24
    关注
    source example.sql

    需要加完整路径,即example.sql所在的目录路径,比如在E盘中的话

    source E:\example.sql

    另外一点,需要确认下这个sql文件中有没有选择DB,如果没有写的话,可以先use下DB

    评论

报告相同问题?