0

I am a fairly new student currently enrolled in Python and SQL for Data Science course from a website called Scaler. As part of the course, I am trying to understand the concepts of MySQL.

The instructor provided an SQL file named imdb.sql and demonstrated how to upload it to MySQL using the source command. However, whenever I try to do the same, I encounter the following error:

ERROR:
mysql> source D:\sqlpracticescaler\imdb.sql;
--------------
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe  Ver 8.0.37 for Win64 on x86_64 (MySQL Community Server - GPL)

Connection id:          10
Current database:       imdb
Current user:           root@localhost
SSL:                    Cipher in use is TLS_AES_256_GCM_SHA384
Using delimiter:        ;
Server version:         8.0.37 MySQL Community Server - GPL
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    cp850
Conn.  characterset:    cp850
TCP port:               3306
Binary data as:         Hexadecimal
Uptime:                 9 hours 23 min 57 sec

Threads: 2  Questions: 31  Slow queries: 0  Opens: 145  Flush tables: 3  Open tables: 64  Queries per second avg: 0.000
--------------

ERROR:
Unknown command '\i'.
ERROR:
Failed to open file 'D:qlpracticescaler\imdb.sql', error: 2

I have double-checked the file path and ensured the file exists.

Additional Information: MySQL version: mysql Ver 8.0.37 for Win64 on x86_64 (MySQL Community Server - GPL) Operating system: Windows 64-bit operating system Size of imdb.sql file: 150,181 KB

What could be causing this error, and how can I successfully upload the imdb.sql file to my MySQL database using the source command?

Any help or guidance would be greatly appreciated. Thank you!

3
  • Escape the slashes: source D:\\sqlpracticescaler\\imdb.sql; (or use /) Commented Jun 24, 2024 at 11:50
  • 1
    42 years of confusion caused by Microsoft's decision to use backlsash as their default directory separator. 😢 Commented Jun 24, 2024 at 14:38
  • This is a typical typo, if you read carefully your error message. Failed to open file 'D:qlpracticescaler\imdb.sql' And you have D:\sqlpracticescaler\imdb.sql; - Missing \s. Commented Jul 9, 2024 at 4:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.