新しくインストールしたKubuntu20.04にMariaDBをフレッシュインストールします。 「ストック」データベースを使用してMariaDBを正常にセットアップした後、正常に実行されていました。次に、/ var/lib/mysqlの元の内容を移動して名前を変更し、バインドマウントを使用して、実際のデータベースを新しい/ var/lib/mysqlフォルダーに取り込みました。再起動後、実際のデータベースは正しいフォルダにあり、正しい権限がありますが、MariaDBサーバーは起動しなくなります。私はすでにこの手順をKubuntu19.04、Kubuntu 19.10、Manjaroなどで正常に使用しています。Fedora31、OpenSUSE、Mageiaなどでは機能させることができませんでした。
systemctl statusmariadbとjournalctl-xeの出力は次のとおりです。
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-04-30 14:55:16 CEST; 12min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 3343 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 3348 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 3362 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 3411 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 3411 (code=exited, status=1/FAILURE)
Apr 30 14:55:16 murphy systemd[1]: Starting MariaDB 10.3.22 database server...
Apr 30 14:55:16 murphy mysqld[3411]: 2020-04-30 14:55:16 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-1ubuntu1) starting as process 3411 ...
Apr 30 14:55:16 murphy systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Apr 30 14:55:16 murphy systemd[1]: mariadb.service: Failed with result 'exit-code'.
Apr 30 14:55:16 murphy systemd[1]: Failed to start MariaDB 10.3.22 database server.
Starting MariaDB 10.3.22 database server...
-- Subject: A start job for unit mariadb.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit mariadb.service has begun execution.
--
-- The job identifier is 2434.
Apr 30 15:20:18 murphy mysqld[3849]: 2020-04-30 15:20:18 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-1ubuntu1) starting as process 3849 ...
Apr 30 15:20:18 murphy systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit mariadb.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Apr 30 15:20:18 murphy systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Apr 30 15:20:18 murphy systemd[1]: Failed to start MariaDB 10.3.22 database server.
-- Subject: A start job for unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit mariadb.service has finished with a failure.
--
-- The job identifier is 2434 and the job result is failed.
Apr 30 15:21:13 murphy su[2897]: pam_unix(su:session): session closed for user root
Apr 30 15:21:13 murphy Sudo[2896]: pam_unix(Sudo:session): session closed for user root
誰かが私がこれを明確にするのを手伝ってくれる?より多くの情報を提供する必要がありますか?ありがとう、
theber
Attie:これがjournalctl -umariadb.serviceの出力です
-- Logs begin at Sat 2020-04-25 15:11:36 CEST, end at Thu 2020-04-30 20:46:28 CEST. --
Apr 30 13:25:09 murphy systemd[1]: Starting MariaDB 10.3.22 database server...
Apr 30 13:25:09 murphy mysqld[4197]: 2020-04-30 13:25:09 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-1ubuntu1) starting as process 4197 ...
Apr 30 13:25:09 murphy systemd[1]: Started MariaDB 10.3.22 database server.
Apr 30 13:25:09 murphy /etc/mysql/debian-start[4233]: Upgrading MySQL tables if necessary.
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Looking for 'mysql' as: /usr/bin/mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 1/7: Checking and upgrading mysql database
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.column_stats OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.columns_priv OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.db OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.event OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.func OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.gtid_slave_pos OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_category OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_keyword OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_relation OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_topic OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.Host OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.index_stats OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.innodb_index_stats OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.innodb_table_stats OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.plugin OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.proc OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.procs_priv OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.proxies_priv OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.roles_mapping OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.servers OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.table_stats OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.tables_priv OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_leap_second OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_name OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_transition OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_transition_type OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.transaction_registry OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.user OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 2/7: Installing used storage engines... Skipped
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 3/7: Fixing views
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: information_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: performance_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 4/7: Running 'mysql_fix_privilege_tables'
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 5/7: Fixing table and database names
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: information_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: performance_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 6/7: Checking and upgrading tables
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: information_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: performance_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 7/7: Running 'FLUSH PRIVILEGES'
/var/log/mysql/error.logの出力:
2020-05-01 8:50:24 0 [Note] InnoDB: Using Linux native AIO
2020-05-01 8:50:24 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-05-01 8:50:24 0 [Note] InnoDB: Uses event mutexes
2020-05-01 8:50:24 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-05-01 8:50:24 0 [Note] InnoDB: Number of pools: 1
2020-05-01 8:50:24 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-05-01 8:50:24 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-05-01 8:50:24 0 [Note] InnoDB: Completed initialization of buffer pool
2020-05-01 8:50:24 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriorit>
2020-05-01 8:50:24 0 [Note] InnoDB: Downgrading redo log: 2*50331648 bytes; LSN=22077728
2020-05-01 8:50:24 0 [Note] InnoDB: Starting to delete and rewrite log files.
2020-05-01 8:50:24 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 50331648 bytes
2020-05-01 8:50:24 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 50331648 bytes
2020-05-01 8:50:24 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2020-05-01 8:50:24 0 [Note] InnoDB: New log files created, LSN=22077728
2020-05-01 8:50:25 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-05-01 8:50:25 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-01 8:50:25 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-01 8:50:25 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-05-01 8:50:25 0 [Note] InnoDB: Waiting for purge to start
2020-05-01 8:50:25 0 [Note] InnoDB: 10.3.22 started; log sequence number 22077728; transaction id 31153
2020-05-01 8:50:25 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-05-01 8:50:25 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-01 8:50:25 0 [Note] Recovering after a crash using tc.log
2020-05-01 8:50:25 0 [Note] Starting crash recovery...
2020-05-01 8:50:25 0 [Note] Crash recovery finished.
2020-05-01 8:50:25 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-05-01 8:50:25 0 [ERROR] Fatal error: Can't open and lock privilege tables: 'mysql.user' is not of type 'TABLE'
まったく同じバージョンのMariaDBlのManjaroでこれを実行してもよろしいですか?ログは質問の中で10.3.22に言及しています。 Manjaroリポジトリで確認できることから、現在出荷されているバージョンは10.4です。
10.4以降、すべてのシステムテーブル(ユーザーテーブルを含む)はAria形式であり、古いバージョンではMyISAM形式です。これは、10.3以前で10.4にアップグレードされたデータベースを起動しようとした場合に予想される種類のエラーです。