While Creating New Site get Syntax error in query: create sequence if not exists scheduled_job_log_id_seq nocache nocycle None

MySQL root password:

Installing frappe…
Updating DocTypes for frappe : [==== ] 12%Syntax error in query:
create sequence if not exists scheduled_job_log_id_seq nocache nocycle None

There was an issue while migrating the DocType: Scheduled Job Log

Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 109, in
main()
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/commands/site.py”, line 74, in new_site
_new_site(
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/installer.py”, line 101, in _new_site
install_app(app, verbose=verbose, set_as_patched=not source_sql, force=False)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/installer.py”, line 289, in install_app
sync_for(name, force=force, reset_permissions=True)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/model/sync.py”, line 80, in sync_for
import_file_by_path(
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 145, in import_file_by_path
import_doc(
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 242, in import_doc
doc.insert()
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/model/document.py”, line 281, in insert
self.run_post_save_methods()
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/model/document.py”, line 1087, in run_post_save_methods
self.run_method(“on_update”)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/model/document.py”, line 928, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/model/document.py”, line 1268, in composer
return composed(self, method, *args, **kwargs)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/model/document.py”, line 1250, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/model/document.py”, line 925, in fn
return method_object(*args, **kwargs)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 385, in on_update
raise e
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 382, in on_update
frappe.db.updatedb(self.name, Meta(self))
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 365, in updatedb
db_table.sync()
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/database/schema.py”, line 41, in sync
self.create()
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py”, line 43, in create
frappe.db.create_sequence(self.doctype, check_not_exists=True, cache=frappe.db.SEQUENCE_CACHE)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/database/database.py”, line 1289, in create_sequence
return create_sequence(*args, **kwargs)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/database/sequence.py”, line 54, in create_sequence
db.sql_ddl(query)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/database/database.py”, line 341, in sql_ddl
self.sql(query, debug=debug)
File “/home/indictrans/workspace/kspl_14/frappe-bench/apps/frappe/frappe/database/database.py”, line 209, in sql
self._cursor.execute(query, values)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/indictrans/workspace/kspl_14/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (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 ‘sequence if not exists scheduled_job_log_id_seq nocache nocycle’ at line 1”)

i got this issue when migrated from v13 to (v14.5 i think) then the next day i updated to 14.7 and migrated old db with hrms installed and the problem disappeared but there may be other reasons

My problem is related to MariaDB, For version-14, required 10.4 MariaDB Onward

same as You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near - #5 by Abdullah_Yassin