LoginSignup
3
3

More than 5 years have passed since last update.

Javaで組み込みMySQLを使用したらエラー

Last updated at Posted at 2016-10-25

Java アプリケーションのテストなどに有用な、組み込み MySQL として便利に使わせてもらっている wix-embedded-mysql なのですが、立てたばかりの Ubuntu 14.04 でテストしたところエラーが発生しました。
README にしっかりそれらしきことは書いてあったわけですが、微妙なバージョン差異などから見逃してしまっていたため、メモ。

Wix Embedded MySql
https://github.com/wix/wix-embedded-mysql

環境

  • Ubuntu 14.04.3 LTS
  • Java 8
  • Maven 3.3.9 (Maven Wrapper)
  • Wix Embedded MySql 2.0.1 (MySQL 5.5.40)
$ ./mvnw --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: /home/ubuntu/.m2/wrapper/dists/apache-maven-3.3.9-bin/2609u9g41na2l7ogackmif6fj2/apache-maven-3.3.9
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-74-generic", arch: "amd64", family: "unix"

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"

事象

Version.v5_5_40 を使用して、Wix MySQL を起動しようとしたところ、以下のようなエラーに出くわしました。

Command exited with error code: '1' and output: ''

対応

README にも、Known issues としてあげられているように、libaio1.so をインストールすれば良いです。

Known issues

mysql, starting version 5.5.10 requires libaio1.so to be preinstalled on linux, but that is not the case for some linux distributions. Proper error is emitted if it's missing and you have to install it manually (ex. ubuntu):
sudo apt-get install libaio1

以下のようにモジュールインストール後は、無事にエラーが解消されました。

$ sudo apt-get install libaio1

まとめ

  • Wix Embedded MySQL で、Command exited with error code: '1' and output: '' に出くわしたら、sudo apt-get install libaio1
  • README はちゃんと読もう。
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3