Home > database >  Wix embedded mysql does not start due CommandFailedException due 'Stream closed'
Wix embedded mysql does not start due CommandFailedException due 'Stream closed'

Time:01-14

Trying to run my embedded mysql based Unit tests I get an exception with this part:

Failed to instantiate [com.wix.mysql.EmbeddedMysql]: Factory method 'getEmbeddedMysql' threw exception; nested exception is com.wix.mysql.exceptions.CommandFailedException: Command 'CREATE USER 'sa'@'%' IDENTIFIED BY '';' on schema 'information_schema' failed with message 'Stream closed'

The same unit test and environment setup work on my MacBook

This machine with the error is an Ubuntu 20.04 Wix version is 4.6.2; Java 8, mysql.connector 8.0.24

I tried changing the dependencies versions and also tried with Java 11. Run from within IntelliJ and on the command line. Same result.

CodePudding user response:

Let me put the full comment I found in Github which helped me to fix this and I'm pretty sure most of the people seeing this in Ubuntu will find this as the solution:

I had this same issue with MySQL 5.7, while working on another open source project. I cloned the wix-embedded-mysql repository and ran the tests using the master branch, which also failed in the exact same way, except that I received a longer, more thorough message in the catch.

The issue was that I was on Ubuntu and did not have the ncurses 5 shared library installed. On ubuntu, I installed libncurses5 (apt install libncurses5) and everything started working (all tests on wix, and on my project).

I hope this helps resolve the issue.

Thanks to https://github.com/codesplode

  • Related