SQLite3 database on a file, copied at any time to take away, debugging convenient, super lightweight, has its benefits.
However, MySQL is the mainstream of small and medium-sized projects, recently wanted to deploy the Django Milestone project to the SAE, so try to replace the original project database with MySQL, the recording process is as follows.
- Install the interface for Python and MySQL
URL for http://www.lfd.uci.edu/~gohlke/pythonlibs/, this dick, basically Python plugin library have, I use the python2.7, so download Mysql?python?1.2.5.win32? Py2.7.exe, and installed;
Under the Python command line import _mysql,import mysqldb (note: case sensitive) are successful, the installation is successful!
Directly installed Wamp, this integrated mysql,php,apache and so on, very convenient things.
Build the database in MySQL, here I build the Myenrich database based on the project (preferably with the character set, coding problem annoying dead)!
No nonsense,
Django's original code is not changed, thank goodness, too convenient, moved to cry. But a run, the problem comes, the fucking can't insert Chinese ah, this is the database problem.
For a long while, tried a lot of methods, the database character set to change is not good.
Finally, the character set of this table is changed so that, "ALTER table xxx CONVERT to CHARACTER SET UTF8;"
Details Visible: http://blog.sina.com.cn/s/blog_4de067e40100ebvm.html
But I want to be a lot of tables what to do ... Before the database was built with the character set, it should be possible, I have not tried.
"Fix" Django project abandoned SQLite3 embrace MySQL