Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL обновился и такое #81

Open
bravo321 opened this issue Aug 25, 2021 · 2 comments
Open

MySQL обновился и такое #81

bravo321 opened this issue Aug 25, 2021 · 2 comments

Comments

@bravo321
Copy link

bravo321 commented Aug 25, 2021

(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET sql_mode='STRICT_TRANS_TABLES';                        SET NAMES UTF8 COL...' at line 1")
Request Method:	GET
Request URL:	http://bla.bla123.ru:4444/web/
Django Version:	2.1.15
Exception Type:	ProgrammingError
Exception Value:	
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET sql_mode='STRICT_TRANS_TABLES';                        SET NAMES UTF8 COL...' at line 1")
Exception Location:	/usr/lib/python3.9/site-packages/MySQLdb/connections.py in __init__, line 185
Python Executable:	/usr/bin/python3
Python Version:	3.9.6
Python Path:	
['/opt/sopds',
 '/usr/lib/python39.zip',
 '/usr/lib/python3.9',
 '/usr/lib/python3.9/lib-dynload',
 '/usr/lib/python3.9/site-packages']
Server time:	Tue, 24 Aug 2021 17:13:06 +0300
@bravo321
Copy link
Author

bravo321 commented Sep 5, 2021

Ладно, будем считать что проект, скорее мёртв, чем жив ...
Переделал базу на PostgreSQL, тоже не без плясок с бубном, там вываливалась ошибка :
AssertionError: database connection isn't set to UTC
Но её я таки поборол ...

@ayaye
Copy link

ayaye commented Feb 12, 2022

Глубоко не разбирался, проблема с настройками базы данных django. Переделал опции, заработало.

sopds/settings.py:

        'OPTIONS' : {
            'init_command': 'SET default_storage_engine=INNODB, sql_mode="STRICT_TRANS_TABLES", NAMES UTF8 COLLATE utf8_general_ci',
            'isolation_level': 'read committed'
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants