当我从终端调用它时,mysql函数不存在

时间:2013-06-14 14:01:31

标签: mysql

我正在尝试使用我创建的函数将一些数据存储在文件中。当我使用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

它返回

  

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

为什么找不到我的功能?

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

0 个答案:

没有答案