我正在尝试在 Ubuntu 的命令行中对 foodmart 数据库执行查询,或者如果可能的话,在 python 中更好:
http://pentaho.dlpage.phi-integration.com/mondrian/mysql-foodmart-database
我试过了 mysql -uroot -p <foodmart_mysql.sql
我得到了ERROR 1046 (3D000) at line 22: No database selected
.我搜索了此错误,发现我需要检查“USE databsename or something like this in the
” sql file and make sure that it is not there. However, there is not any
在文件中使用`命令。
感谢任何帮助或评论。
谢谢, 阿夫欣
最佳答案
您似乎要恢复一些 .sql
文件。
这是命令行中的代码:
mysql -u UsernameHere -p YourPasswordHere dbnamehere < "D:\sample.sql"
在此之前首先找到你的 mysql 目录,例如:
cd C:\Program Files (x86)\MySQL\MySQL Server 6.0\bin
确保 mysql.exe 位于此目录。
然后输入上面的代码。
祝你好运
关于mysql - 在 ubuntu 和 python 中对 foodmart_mysql.sql 文件执行查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54247538/