mitshel / sopds

Simple opds catalog
http://www.sopds.ru/
Other
210 stars 79 forks source link

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

Open bravo321 opened 2 years ago

bravo321 commented 2 years ago
(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 commented 2 years ago

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

ayaye commented 2 years ago

Глубоко не разбирался, проблема с настройками базы данных 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'
        }