【问题标题】:How to add SUPER priviledge to MySQL in pythonanywhere?如何在 pythonanywhere 中向 MySQL 添加 SUPER 权限?
【发布时间】:2020-03-27 17:26:34
【问题描述】:

我正在使用 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 所述(其中用户名=创建的用户名),但它抛出了这个错误:

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'

请帮帮我。

【问题讨论】:

    标签: python mysql flask pythonanywhere


    【解决方案1】:

    看看PythonAnywhere forums上的答案:

    您将无法在 MySQL 上获得超级权限(仅限 postgres)。您可以在还原之前禁用二进制日志记录吗? 您可以尝试编辑 ab.sql 文件以删除该行,或者 从您最初创建 sqldump 的任何位置将其关闭, 并再次执行 sqldump。

    【讨论】:

    • 好吧,我设法摆脱了这个问题,但现在出现了一种新的问题。我的数据库表附带了触发器,但我看到触发器不起作用。我该如何解决这个问题?
    • PythonAnywhere 不支持触​​发器,不幸的是:-(
    猜你喜欢
    • 2019-12-13
    • 1970-01-01
    • 2016-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-18
    • 1970-01-01
    • 2021-05-08
    相关资源
    最近更新 更多