The problem: it is possible that the following error occurs when working with MariaDB:
- Code: Select all
ERROR 1558 (HY000) at line 70781: Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 100108, now running 100316. Please use mysql_upgrade to fix this error
The cause: XAMPP still uses the old internal database files (e.g. responsible for the table mysql.proc) from MariaDB 10.1.* versions, e.g. for the proc table (note the date):
- Code: Select all
root@8b1bb1f1bc83:/# ll /opt/lampp/var/mysql/mysql | grep proc
-rw-rw---- 1 mysql mysql 1108 Nov 24 2015 proc.MYD
-rw-rw---- 1 mysql mysql 4096 Nov 24 2015 proc.MYI
-rw-rw---- 1 mysql mysql 3418 Nov 24 2015 proc.frm
-rw-rw---- 1 mysql mysql 1234 Nov 24 2015 procs_priv.MYD
-rw-rw---- 1 mysql mysql 10240 Nov 24 2015 procs_priv.MYI
-rw-rw---- 1 mysql mysql 2874 Nov 24 2015 procs_priv.frm
This corresponding table has only 20 columns:
- Code: Select all
root@8b1bb1f1bc83:/# /opt/lampp/bin/mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.3.16-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> USE mysql;
Database changed
MariaDB [mysql]> DESCRIBE proc;
+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+-------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+-------------------------------+
| db | char(64) | NO | PRI | | |
| name | char(64) | NO | PRI | | |
| type | enum('FUNCTION','PROCEDURE') | NO | PRI | NULL | |
| specific_name | char(64) | NO | | | |
| language | enum('SQL') | NO | | SQL | |
| sql_data_access | enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') | NO | | CONTAINS_SQL | |
| is_deterministic | enum('YES','NO') | NO | | NO | |
| security_type | enum('INVOKER','DEFINER') | NO | | DEFINER | |
| param_list | blob | NO | | NULL | |
| returns | longblob | NO | | NULL | |
| body | longblob | NO | | NULL | |
| definer | char(141) | NO | | | |
| created | timestamp | NO | | current_timestamp() | on update current_timestamp() |
| modified | timestamp | NO | | 0000-00-00 00:00:00 | |
| sql_mode | set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') | NO | | | |
| comment | text | NO | | NULL | |
| character_set_client | char(32) | YES | | NULL | |
| collation_connection | char(32) | YES | | NULL | |
| db_collation | char(32) | YES | | NULL | |
| body_utf8 | longblob | YES | | NULL | |
+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+-------------------------------+
20 rows in set (0.001 sec)
but MariaDB 10.3.* requires 21 columns (the new column aggregate is missing).
The solution: if you shipped XAMPP with the correct files for the internal database structure, this problem should be gone.
The workaround: for users currently experiencing this issue, it is sufficient to trigger the mysql update process:
- Code: Select all
/opt/lampp/lampp start
/opt/lampp/bin/mysql_upgrade
/opt/lampp/lampp stop
and everything should work as expected
Note: this bug does only affect the Linux version of XAMPP but not the Windows version (for Mac I don't know).