DBeaver 导出到 csv:"No database selected"
DBeaver export to csv: "No database selected"
select * from users u
where u.id < 1000
当我右键单击脚本并导出时,出现未选择数据库错误。
当我在上面添加“use db”命令时,出现语法错误。
use db
select * from users u
where u.id < 1000
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM..'
如何在 DBeaver 中导出?
我使用的是 MacOS,如果重要的话,db 使用的是 MariaDB。
您必须用分号分隔多个语句 (1),或者您可以将数据库名称直接传递给您的语句 (2):
(1):
use db;
select columns from users u ...
(2):
select columns from db.users u ....
根据您的评论,我现在明白这是一个关于 DBeaver 的使用问题。您只需确保在脚本选项卡上方的菜单栏中 select 您的数据库,如下所述:https://dbeaver.com/docs/wiki/SQL-Editor/。例如,请参见下面的屏幕截图:
select * from users u
where u.id < 1000
当我右键单击脚本并导出时,出现未选择数据库错误。
当我在上面添加“use db”命令时,出现语法错误。
use db
select * from users u
where u.id < 1000
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM..'
如何在 DBeaver 中导出? 我使用的是 MacOS,如果重要的话,db 使用的是 MariaDB。
您必须用分号分隔多个语句 (1),或者您可以将数据库名称直接传递给您的语句 (2):
(1):
use db;
select columns from users u ...
(2):
select columns from db.users u ....
根据您的评论,我现在明白这是一个关于 DBeaver 的使用问题。您只需确保在脚本选项卡上方的菜单栏中 select 您的数据库,如下所述:https://dbeaver.com/docs/wiki/SQL-Editor/。例如,请参见下面的屏幕截图: