Problem after migrate from MariaDB 10.3 to 10.4 #4458

Closed
opened 2025-11-02 05:51:34 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @PVasileff on GitHub (Dec 7, 2019).

  • Gitea version (or commit ref): 1.10.1
  • Git version: 2.20.1
  • Operating system: Debian 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • [] MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

2019/12/07 11:13:44 routers/init.go:59:initDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: commands out of sync. Did you run multiple statements at once?
2019/12/07 11:13:44 routers/init.go:60:initDBEngine() [I] Backing off for 3 seconds
2019/12/07 11:13:47 routers/init.go:53:initDBEngine() [I] ORM engine initialization attempt #8/10...
2019/12/07 11:13:47 ...-xorm/xorm/engine.go:330:Ping() [I] PING DATABASE mysql
2019/12/07 11:13:47 routers/init.go:59:initDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: commands out of sync. Did you run multiple statements at once?
2019/12/07 11:13:47 routers/init.go:60:initDBEngine() [I] Backing off for 3 seconds

Description

I migrate my gitea from debian 10, mariadb 10.3 (from apt installed) from debian repo to
debian 10, mariadb 10.4 (from mariadb repository installed).

MySQL database has been dumped from 10.3 with:
mysqldump --single-transaction gitea > gitea.sql

Strict mode on new MariaDB 10.4 was disabled:
mysql -e 'select @@GLOBAL.sql_mode;'
+------------------------+
| @@GLOBAL.sql_mode |
+------------------------+
| NO_ENGINE_SUBSTITUTION |
+------------------------+

MySQL database name. user and password was correct.
Is there any ideas how to fix that ?
...

Originally created by @PVasileff on GitHub (Dec 7, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.10.1 - Git version: 2.20.1 - Operating system: Debian 10 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: 2019/12/07 11:13:44 routers/init.go:59:initDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: commands out of sync. Did you run multiple statements at once? 2019/12/07 11:13:44 routers/init.go:60:initDBEngine() [I] Backing off for 3 seconds 2019/12/07 11:13:47 routers/init.go:53:initDBEngine() [I] ORM engine initialization attempt #8/10... 2019/12/07 11:13:47 ...-xorm/xorm/engine.go:330:Ping() [I] PING DATABASE mysql 2019/12/07 11:13:47 routers/init.go:59:initDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: commands out of sync. Did you run multiple statements at once? 2019/12/07 11:13:47 routers/init.go:60:initDBEngine() [I] Backing off for 3 seconds ## Description I migrate my gitea from debian 10, mariadb 10.3 (from apt installed) from debian repo to debian 10, mariadb 10.4 (from mariadb repository installed). MySQL database has been dumped from 10.3 with: mysqldump --single-transaction gitea > gitea.sql Strict mode on new MariaDB 10.4 was disabled: mysql -e 'select @@GLOBAL.sql_mode;' +------------------------+ | @@GLOBAL.sql_mode | +------------------------+ | NO_ENGINE_SUBSTITUTION | +------------------------+ MySQL database name. user and password was correct. Is there any ideas how to fix that ? ...
Author
Owner

@PVasileff commented on GitHub (Dec 7, 2019):

Here is MariaDB 10.3 my.cnf configuration:

[server]

[mysqld]

user                    = mysql
pid-file                = /run/mysqld/mysqld.pid
socket                  = /run/mysqld/mysqld.sock
port                    = 3306
basedir                 = /usr
datadir                 = /var/lib/mysql
tmpdir                  = /tmp
lc-messages-dir         = /usr/share/mysql

bind-address            = 127.0.0.1

sql-mode="NO_ENGINE_SUBSTITUTION"

key_buffer_size        = 16M
max_allowed_packet     = 16M
thread_stack           = 192K
thread_cache_size      = 8
myisam_recover_options = BACKUP

query_cache_limit       = 1M
query_cache_size        = 16M

log_error = /var/log/mysql.err
slow_query_log_file    = /var/log/mysql.slow
expire_logs_days        = 10
max_binlog_size         = 100M

innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1


character-set-server  = utf8mb4
collation-server      = utf8mb4_general_ci



[embedded]

[mariadb]

[mariadb-10.3]

Here is MariaDB 10.4 config file:

[client]
default-character-set = utf8mb4
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld_safe]
log_error = /var/log/mysql/mysql-error.log
nice = 0
socket = /var/run/mysqld/mysqld.sock

[mysqld]
# Disable mysql strict mode
sql-mode="NO_ENGINE_SUBSTITUTION"
basedir = /usr
bind-address = 127.0.0.1
binlog_format = ROW
bulk_insert_buffer_size = 16M
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
concurrent_insert = 2
connect_timeout = 5
datadir = /var/lib/mysql
default_storage_engine = InnoDB
expire_logs_days = 10
general_log_file = /var/log/mysql/mysql.log
general_log = 0
innodb_buffer_pool_size = 1024M
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
innodb_file_per_table = 1
innodb_open_files = 400
innodb_io_capacity = 4000
innodb_flush_method = O_DIRECT
# nextcloud tune
innodb_file_format=barracuda
innodb_large_prefix=true
key_buffer_size = 128M
lc_messages_dir = /usr/share/mysql
lc_messages = en_US
#log_bin = /var/log/mysql/mysql-bin
#log_bin_index = /var/log/mysql/mysql-bin.index
log_error=/var/log/mysql/mysql.err
log_slow_verbosity = query_plan
log_warnings = 2
long_query_time = 1
max_allowed_packet = 16M
max_binlog_size = 100M
max_connections = 200
max_heap_table_size = 64M
myisam_recover_options = BACKUP
myisam_sort_buffer_size = 512M
port = 3306
pid-file = /var/run/mysqld/mysqld.pid
query_cache_limit = 2M
query_cache_size = 64M
query_cache_type = 1
query_cache_min_res_unit = 2k
read_buffer_size = 2M
read_rnd_buffer_size = 1M
skip-external-locking
skip-name-resolve
slow_query_log_file = /var/log/mysql/mysql.slow
slow-query-log = 1
socket = /var/run/mysqld/mysqld.sock
sort_buffer_size = 4M
table_open_cache = 400
thread_cache_size = 128
tmp_table_size = 64M
tmpdir = /tmp
transaction_isolation = READ-COMMITTED
user = mysql
wait_timeout = 600

[mysqldump]
max_allowed_packet = 16M
quick
quote-names

[isamchk]
key_buffer = 16M
@PVasileff commented on GitHub (Dec 7, 2019): Here is MariaDB 10.3 my.cnf configuration: ``` [server] [mysqld] user = mysql pid-file = /run/mysqld/mysqld.pid socket = /run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql bind-address = 127.0.0.1 sql-mode="NO_ENGINE_SUBSTITUTION" key_buffer_size = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 myisam_recover_options = BACKUP query_cache_limit = 1M query_cache_size = 16M log_error = /var/log/mysql.err slow_query_log_file = /var/log/mysql.slow expire_logs_days = 10 max_binlog_size = 100M innodb_large_prefix=true innodb_file_format=barracuda innodb_file_per_table=1 character-set-server = utf8mb4 collation-server = utf8mb4_general_ci [embedded] [mariadb] [mariadb-10.3] ``` Here is MariaDB 10.4 config file: ``` [client] default-character-set = utf8mb4 port = 3306 socket = /var/run/mysqld/mysqld.sock [mysqld_safe] log_error = /var/log/mysql/mysql-error.log nice = 0 socket = /var/run/mysqld/mysqld.sock [mysqld] # Disable mysql strict mode sql-mode="NO_ENGINE_SUBSTITUTION" basedir = /usr bind-address = 127.0.0.1 binlog_format = ROW bulk_insert_buffer_size = 16M character-set-server = utf8mb4 collation-server = utf8mb4_general_ci concurrent_insert = 2 connect_timeout = 5 datadir = /var/lib/mysql default_storage_engine = InnoDB expire_logs_days = 10 general_log_file = /var/log/mysql/mysql.log general_log = 0 innodb_buffer_pool_size = 1024M innodb_buffer_pool_instances = 1 innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 32M innodb_max_dirty_pages_pct = 90 innodb_file_per_table = 1 innodb_open_files = 400 innodb_io_capacity = 4000 innodb_flush_method = O_DIRECT # nextcloud tune innodb_file_format=barracuda innodb_large_prefix=true key_buffer_size = 128M lc_messages_dir = /usr/share/mysql lc_messages = en_US #log_bin = /var/log/mysql/mysql-bin #log_bin_index = /var/log/mysql/mysql-bin.index log_error=/var/log/mysql/mysql.err log_slow_verbosity = query_plan log_warnings = 2 long_query_time = 1 max_allowed_packet = 16M max_binlog_size = 100M max_connections = 200 max_heap_table_size = 64M myisam_recover_options = BACKUP myisam_sort_buffer_size = 512M port = 3306 pid-file = /var/run/mysqld/mysqld.pid query_cache_limit = 2M query_cache_size = 64M query_cache_type = 1 query_cache_min_res_unit = 2k read_buffer_size = 2M read_rnd_buffer_size = 1M skip-external-locking skip-name-resolve slow_query_log_file = /var/log/mysql/mysql.slow slow-query-log = 1 socket = /var/run/mysqld/mysqld.sock sort_buffer_size = 4M table_open_cache = 400 thread_cache_size = 128 tmp_table_size = 64M tmpdir = /tmp transaction_isolation = READ-COMMITTED user = mysql wait_timeout = 600 [mysqldump] max_allowed_packet = 16M quick quote-names [isamchk] key_buffer = 16M ```
Author
Owner

@PVasileff commented on GitHub (Dec 7, 2019):

Problem solved after change:

HOST = localhost:3306

to:

HOST = /var/run/mysqld/mysqld.sock

in section

[database]

@PVasileff commented on GitHub (Dec 7, 2019): Problem solved after change: `HOST = localhost:3306` to: `HOST = /var/run/mysqld/mysqld.sock` in section [database]
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4458