In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. The error message of the running project is as follows:
File "/ home/pyvip/.virtualenvs/myblog/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 36, in raise ImproperlyConfigured ('mysqlclient 1.3.13 or newer is required; you have% s.'% Database.__version__) django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
Mysql version is too low, enter / home/pyvip/.virtualenvs/myblog/lib/python3.6/site-
Packages/django/db/backends/mysql/base.py, open it with vim
355036 lines need to be commented out, and then there will be no error due to the version. Type wq in the last line mode to save and exit.
Second, run the project again and report the following error
File "/ home/pyvip/.virtualenvs/myblog/lib/python3.6/site-packages/django/db/backends/mysql/operations.py", line 146, in last_executed_query query = query.decode (errors='replace') AttributeError: 'str' object has no attribute' decode'
Use vim to enter / home/pyvip/.virtualenvs/myblog/lib/python3.6/site-packages/django/db/backends/mysql/operations.py
In line 146, change decode to encode
If you run the project again at this time, you can see that it has been run successfully! Prove that the mysql database connection is successful!
Summary
The above is the method of connecting to the mysql database in the django2.2 version introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave a message for me, and the editor will reply to you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.