Original address: http://blog.csdn.net/gamesofsailing/article/details/21465327
After successfully installing PYTHON-MYSQL, start configuring the Django MySQL connection configuration
Open the setting.py file under the Django Project and change the databases to the following
DATABASES = {
' Default ': {
' ENGINE ': ' Django.db.backends.mysql ',
'NAME':' MySite ',
' USER ': ' Root ',
' PASSWORD ': ',
' HOST ': ' 127.0.0.1 ',
' PORT ': ' 3306 ',
}
}
Last run:
Python mange.py Dbshell
Successfully entered MySQL shell
[Plain]View Plaincopy
- Mylittlefishdemacbook-air:mysite mylittlefish$ python manage.py Dbshell
- Welcome to the MySQL Monitor. Commands End With; or \g.
- Your MySQL Connection ID is 5
- Server version:5.6.16 MySQL Community Server (GPL)
- Copyright (c), the Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of the Oracle Corporation and/or its
- Affiliates. Other names trademarks of their respective
- Owners.
- Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
- Mysql>