Python Django与mysql安装模块mac ox
我想在Django项目中使用mysql,但我的mac上总是有模块问题 我有两种问题:/ 第一: 我使用brew mysql,所以我的笔记本电脑上有sql。我尝试使用mysql命令创建数据库,但无法将数据库正确连接到django项目。 我遵循该博客中的协议: 我使用:mysql\u secure\u安装 当我这样做时: manage.py运行服务器 我有:Python Django与mysql安装模块mac ox,python,mysql,django,macos,pymysql,Python,Mysql,Django,Macos,Pymysql,我想在Django项目中使用mysql,但我的mac上总是有模块问题 我有两种问题:/ 第一: 我使用brew mysql,所以我的笔记本电脑上有sql。我尝试使用mysql命令创建数据库,但无法将数据库正确连接到django项目。 我遵循该博客中的协议: 我使用:mysql\u secure\u安装 当我这样做时: manage.py运行服务器 我有: /MySQL_python-1.2.4b4-py2.7-macosx-10.5-x86_64.egg/MySQLdb/connections
/MySQL_python-1.2.4b4-py2.7-macosx-10.5-x86_64.egg/MySQLdb/connections.py", line 187, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (1045, "Access denied for user 'mynameuser'@'localhost' (using password: YES)")
所以我跟着
它是关于创建一个mysql文件,以便在具有良好属性('user','password'等)后打开它
尝试创建数据库时,无法导入:
pymysql
MySQLdb
您是否有任何将Django和MySQL与python结合使用的解决方案
mac和Windows是否有可移植的解决方案?要运行sql数据库,可以使用MySQLdb库 在运行任何django代码之前,您需要执行以下操作: 在manage.py文件中:
import pymysql
pymysql.install_as_MySQLdb()
要运行sql数据库,可以使用MySQLdb库 在运行任何django代码之前,您需要执行以下操作: 在manage.py文件中:
import pymysql
pymysql.install_as_MySQLdb()
您使用的是哪个版本的python?您使用的是哪个版本的python?