如何在pythonanywhere中为MySQL添加超级权限?

2024-06-06 15:14:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用PythonAnywhere来托管我的web应用程序以进行测试。我的前端和python脚本运行良好。现在我想把它连接到MySQL数据库。我已将我的.sql文件上载到mysite文件夹,并尝试使用以下语法还原它:

mysql -u username -h username.mysql.pythonanywhere-services.com 'username$scm' < ab.sql

Backing up (and restoring) MySQL databases(其中username=created username)中所述,但它抛出了以下错误:

ERROR 1419 (HY000) at line 88: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_
trust_function_creators variable)

我试图通过遵循How to grant super privilege to the user?修复此错误,但它仍然引发错误:

ERROR 1044 (42000): Access denied for user 'username'@'%' to database 'username$scm'

请帮帮我


Tags: andthetowebsql错误mysqlusername
1条回答
网友
1楼 · 发布于 2024-06-06 15:14:03

看看PythonAnywhere forums上的答案:

You would not be able to get super privileges on MySQL (only postgres). Could you disable binary logging before doing the restore? You could either try to edit the ab.sql file to take out that line, or turn it off from wherever you were creating the sqldump originally, and doing the sqldump again.

相关问题 更多 >