プロローグ

人生というのは失敗の連続だ。
失敗というもので、人は成長していく。要は、何度も繰り返さないことだ。
そして、今日もまた一つ失敗を積み重ねるのであった。

ノートPCに Ubuntu18.04 LTS 日本語REMIX版をインストールして、10日ほどになる。

こちらにインストールしている LibreOffice から mariadb に接続してみたくなったので、いつものようにPCを起動し、端末を起動して sudo apt update して、sudo apt upgrade とお決まりのコマンドを打ってシステムを更新。

本来デスクトップ用のソフトウェア管理ツールもあるのだけれど、そんなものいるかとばかりコマンドをドヤ顔でうつ。

スタタタ・ッターン

そして何も考えずに、

sudo apt install mariadb-server

 

としてインストール。

普段は、Ubuntu Server を利用しているのでそれが普通だと思っているのだが、Server 版で MariaDB なり MySql をインストールする際に、root ユーザのパスワードを入力する必要があるのだが、こちらの通常版ではなかったので、少し違和感を覚えた。なんだか少し気持ちが悪い

単に sudo mysql と入力するとmysqlのクライアントを使用できるのだけれど、やはりしっくりこないのだ。
そこで、以前、18.04 Server でも行ったように mariadb10.3 のインストールをしてみようとふと思った。何事でも、最新版を使うのが一番気持ちが良いではないか。

そして、

sudo apt remove mariadb-server*

 

などと、purgeをつけずに削除してしまった。。

ここでネットの情報どおりに、ソースツリーにサイトを追加して、

sudo apt update; suodo apt upgrade

 

として、でインストール。途中しっかりとパスワードの設定画面も出てきた。満足。

sudo apt install mariadb-server-10.3

 

インストールもつつがなく終わって、早速起動しようとしてみたところ、以下のようなエラーが・・

ERROR 1524 (HY000): Plugin 'unix_socket' is not loaded

 

ネットで検索してみると、比較的古い情報だったが、unix_socketプラグインを有効にせよとあるので、それに従い、次のように設定ファイルに一行を足した。

[mysqld]
plugin-load-add = auth_socket.so

 

そして、mariadbを再起動させてみたものの、一向に改善できず、結局もう一度パッケージを削除してみることにした。

以下が、削除するときに入力したコマンド。

sudo apt remove mariadb-server-10.3
sudo apt remove mariadb-*
sudo apt remove libdbd-mysql-perl libmysqlclient20 mariadb-common mysql-common

 

更に追い打ちをかけるように、次のディレクトリを削除

sudo rm -R /var/lib/mysql
sudo rm -R /etc/mysql

 

後になって、このように書いてみると嫌な予感しかしない、と思ってしまう。

で、ここでさらに再々インストール

sudo apt install mariadb-server-10.3

 

ところがインストール途中で、エラーを吐いてコケてしまう。

mariadb-server-10.3 (1:10.3.11+maria~bionic) を設定しています ...
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mariadb.service - MariaDB 10.3.11 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Wed 2018-12-12 23:29:18 JST; 19ms ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 14520 ExecStartPost=/etc/mysql/debian-start (code=exited, status=203/EXEC)
  Process: 14488 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 14347 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: 14345 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 14343 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 14488 (code=exited, status=0/SUCCESS)
   Status: "MariaDB server is down"

12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] Event Scheduler: Purging the queue. 0 events
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: FTS optimize thread exiting.
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: Starting shutdown...
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: Buffer pool(s) dump completed at 181212 23:29:16
12月 12 23:29:17 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:17 0 [Note] InnoDB: Shutdown completed; log sequence number 1630985; transaction id 22
12月 12 23:29:17 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:17 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
12月 12 23:29:17 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:17 0 [Note] /usr/sbin/mysqld: Shutdown complete
12月 12 23:29:18 Inspiron-5521 systemd[1]: mariadb.service: Failed with result 'exit-code'.
12月 12 23:29:18 Inspiron-5521 systemd[1]: Failed to start MariaDB 10.3.11 database server.
dpkg: パッケージ mariadb-server-10.3 の処理中にエラーが発生しました (--configure):
 installed mariadb-server-10.3 package post-installation script subprocess returned error exit status 1
libc-bin (2.27-3ubuntu1) のトリガを処理しています ...
処理中にエラーが発生しました:
 mariadb-server-10.3
E: Sub-process /usr/bin/dpkg returned an error code (1)
$

 

エラーの指示通り、systemctl status mariadb.servicesとしてみる。

$ systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.11 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Wed 2018-12-12 23:29:18 JST; 2min 42s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 14520 ExecStartPost=/etc/mysql/debian-start (code=exited, status=203/EXEC)
  Process: 14488 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 14347 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/S
  Process: 14345 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 14343 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 14488 (code=exited, status=0/SUCCESS)
   Status: "MariaDB server is down"

12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] Event Scheduler: Purging the queue. 0 events
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: FTS optimize thread exiting.
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: Starting shutdown...
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:16 0 [Note] InnoDB: Buffer pool(s) dump completed at 181212 23:29:16
12月 12 23:29:17 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:17 0 [Note] InnoDB: Shutdown completed; log sequence number 1630985; transaction id 22
12月 12 23:29:17 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:17 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
12月 12 23:29:17 Inspiron-5521 mysqld[14488]: 2018-12-12 23:29:17 0 [Note] /usr/sbin/mysqld: Shutdown complete
12月 12 23:29:18 Inspiron-5521 systemd[1]: mariadb.service: Failed with result 'exit-code'.
12月 12 23:29:18 Inspiron-5521 systemd[1]: Failed to start MariaDB 10.3.11 database server.

 

さらに、journalctl -xe

/etc$ journalctl -xe
12月 12 23:24:19 Inspiron-5521 mysqld[11711]: 2018-12-12 23:24:19 0 [Note] InnoDB: FTS optimize thread exiting.
12月 12 23:24:19 Inspiron-5521 mysqld[11711]: 2018-12-12 23:24:19 0 [Note] InnoDB: Starting shutdown...
12月 12 23:24:19 Inspiron-5521 mysqld[11711]: 2018-12-12 23:24:19 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
12月 12 23:24:19 Inspiron-5521 mysqld[11711]: 2018-12-12 23:24:19 0 [Note] InnoDB: Buffer pool(s) dump completed at 181212 23:24:19
12月 12 23:24:20 Inspiron-5521 mysqld[11711]: 2018-12-12 23:24:20 0 [Note] InnoDB: Shutdown completed; log sequence number 1652882; transaction id 3338
12月 12 23:24:20 Inspiron-5521 mysqld[11711]: 2018-12-12 23:24:20 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
12月 12 23:24:20 Inspiron-5521 mysqld[11711]: 2018-12-12 23:24:20 0 [Note] /usr/sbin/mysqld: Shutdown complete
12月 12 23:24:20 Inspiron-5521 systemd[1]: Stopped MariaDB 10.3.11 database server.
-- Subject: Unit mariadb.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has finished shutting down.
    :
   途中割愛
    :
12月 12 23:29:16 Inspiron-5521 mysqld[14488]: Version: '10.3.11-MariaDB-1:10.3.11+maria~bionic-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
12月 12 23:29:16 Inspiron-5521 systemd[14520]: mariadb.service: Failed to execute command: No such file or directory
12月 12 23:29:16 Inspiron-5521 systemd[14520]: mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: No such file or directory
-- Subject: Process /etc/mysql/debian-start could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The process /etc/mysql/debian-start could not be executed and failed.
--
-- The error number returned by this process is 2.
    :
    途中割愛
    :
12月 12 23:29:18 Inspiron-5521 systemd[1]: mariadb.service: Failed with result 'exit-code'.
12月 12 23:29:18 Inspiron-5521 systemd[1]: Failed to start MariaDB 10.3.11 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has failed.
--
-- The result is RESULT.
12月 12 23:29:20 Inspiron-5521 sudo[13267]: pam_unix(sudo:session): session closed for user root
12月 12 23:29:57 Inspiron-5521 update-notifier[2038]: GtkDialog mapped without a transient parent. This is discouraged.
$

 

となってしまい、もう、兎にも角にも、インストールも削除もできない状態。

どうやらいろいろとやばいところを削除しちゃった・・のか・な?

・・そうだよな・・

せっかく久しぶりにUbuntuを最新版にしてデスクトップ版放り込んだのに・・

「Ubuntu18.04を入れたらすぐにしておきたい設定」

みたいなのも見ながらカスタマイズして、挙句の果てに見た目も MacOS に寄せてみたというのに、再インストールか・・
再インストールめんどいなぁ・・

 

エピローグ

ネットでいろいろ調べながら

$ sudo dpkg --force-all -r mariadb-server-10.3
$ sudo apt-get --purge remove mysql-server*
$ sudo apt-get --purge remove mysql-common*
$ sudo apt-get --purge remove mariadb-server*

 

として、いろいろと残っているゴミパッケージを削除。

$ sudo aptitude update
$ sudo aptitude safe-upgrade
$ sudo aptitude install mariadb-server-10.3

 

これでようやく、MariaDBに接続・・

$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 49
Server version: 10.3.11-MariaDB-1:10.3.11+maria~bionic-log mariadb.org binary 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)]>

 

・・・お疲れ様でした。


 

 

zaturendo

中小企業社内SE。

0件のコメント

コメントを残す

アバタープレースホルダー

メールアドレスが公開されることはありません。 が付いている欄は必須項目です