Using MySQL with Django - Access denied for user '@'localhost

后端 未结 7 2138
臣服心动
臣服心动 2020-12-07 17:46

So I\'m learning Django (1, 3, 1, \'final\', 0) through this resource: http://www.djangobook.com/en/2.0/chapter05/

I installed \'mysql-server\' and \'python-mysqldb\

7条回答
  •  离开以前
    2020-12-07 18:43

    Just gonna leave my answer here because I lost few good minutes (almost hour) on this matter.

    Watch Your copy-paste :) Unfortunately, mysql return success while granting priviliges for not existing user to not existing database...

    Both queries:

    GRANT ALL PRIVILEGES ON python_user.* TO 'python_db'@'%' WITH GRANT OPTION;
    

    and:

    GRANT ALL PRIVILEGES ON python_db.* TO 'python_user'@'%' WITH GRANT OPTION
    

    will return success. Aldo I don't have such a user called python_db and db named python_user. :) That's sad. My mistake but also MySql was not helpful enough with output. :)

提交回复
热议问题