1

我正在尝试使用我创建的函数将一些数据存储在文件中。当我在 mysql 中使用命令时:

select threadRef, allExpertPosts(threadRef) as 'expertPosts' from chronicweb_data.threads order by threadRef limit 5;

它工作正常。但是,当我从终端调用它时:

mysql -p --batch -B -e 'select threadRef, allExpertPosts(threadRef) as 'expertPosts' from chronicweb_data.threads order by threadRef limit 5' > someThreadsOfOnlyExperts.txt

它返回

第 1 行的错误 1305 (42000):FUNCTION allExpertPosts 不存在

为什么找不到我的功能?

编辑:当我添加数据库时它起作用了。谢谢!

4

0 回答 0