mysql run sql_MySQL:無法運行源table_name.sql

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找到它。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值