I cannot run source table_name.sql when I try, I get the following error: ERROR: Failed to open file 'cars.sql', error: 2
我嘗試時無法運行源table_name.sql,我收到以下錯誤:錯誤:無法打開文件'cars.sql',錯誤:2
我一直關注zeetcode:http://zetcode.com/databases/mysqltutorial/introduction/#mysql http://zetcode.com/databases/mysqltutorial/firststeps/
The first provides a list of commands to create a database called mydb and a set of tables to be used in the tutorial including one named Cars.
第一個提供了一個命令列表,用於創建名為mydb的數據庫和一組要在本教程中使用的表,其中包括一個名為Cars的表。
The second link shows you how to access the databases (SHOW DATABASES;) which I could do but when I go to the previously created database mydb, I can see the previously created tables including Cars (even though the tutorial says I should not see anything.
第二個鏈接向您展示了如何訪問我可以做的數據庫(SHOW DATABASES;)但是當我轉到之前創建的數據庫mydb時,我可以看到之前創建的表包括Cars(盡管教程說我看不到任何東西) 。
when I follow the next command: source cars.sql, I receive the error above yet, this query works: mysql> SELECT * FROM Cars;
當我按照下一個命令:source cars.sql,我收到上面的錯誤,這個查詢工作:mysql> SELECT * FROM Cars;
any ideas as to why the source function would not work?
關於為什么源函數不起作用的任何想法?
This is the first time I am working with mysql.
這是我第一次使用mysql。
1 个解决方案
#1
where is the file cars.sql located? you may need to specify the full path to the file in order for it to be located by mysql.
cars.sql文件在哪里?您可能需要指定文件的完整路徑,以便mysql找到它。