sclorg / mysql-container

MySQL container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
http://softwarecollections.org
Apache License 2.0
128 stars 201 forks source link

Bash syntax error in run-mysqld while starting MySQL container #231

Open fcarrus opened 6 years ago

fcarrus commented 6 years ago

A weird syntax error pops up while starting a MySQL container:

Version: '5.7.21'  socket: '/tmp/mysql.sock'  port: 0  MySQL Community Server (GPL)
---> 13:17:49     MySQL started successfully
/usr/bin/run-mysqld: line 24: [: missing `]'
=> sourcing 40-datadir-action.sh ...

Line 24 in run-mysqld says:

if [ -z "${MYSQL_ROOT_PASSWORD:-}" || is_allowing_connection_with_empty_password ]; then

while it should be:

if [ -z "${MYSQL_ROOT_PASSWORD:-}" ] || [ is_allowing_connection_with_empty_password ]; then
praiskup commented 6 years ago

Thanks for the report. Agreed, would you mind creating a PR for this issue?

snehlatamohite commented 6 years ago

Hi,

We are getting similar issue when trying to start mysql5.7 container on ppc64le platform.

Docker start command - docker run -d --name mysql_database10 -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3310:3306 registry.access.redhat.com/rhscl/mysql-57-rhel7

container logs - 2018-08-17T10:34:09.618630Z 7 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2018-08-17T10:34:09.618677Z 7 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-08-17T10:34:09.618694Z 7 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-08-17T10:34:09.618741Z 7 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-08-17T10:34:09.618750Z 7 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2018-08-17T10:34:09.618774Z 7 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2018-08-17T10:34:09.619070Z 7 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2018-08-17T10:34:09.619088Z 7 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. /usr/bin/run-mysqld: line 24: [: missing `]' ---> 10:34:09 Initialization finished => sourcing 40-datadir-action.sh ... ---> 10:34:10 Running datadir action: upgrade-warn ---> 10:34:10 MySQL server version check passed, both server and data directory are version 5.7. => sourcing 50-passwd-change.sh ...

We have applied the above mentioned patch but after that container does not get started and exits.

Observations - curl command gets response however mysql does not work root@pts00606-vm15:~# curl localhost:3310 5.7.21z\pNPW"▒▒▒6NUb<)-}ok!2mysql_native_password▒Got packets out of order

root@pts00606-vm15:~# mysql -h localhost -p 3310 -u user Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Please help to get the mysql running and also any help on how to access mysql container will be appreciated.

Thanks, Snehlata Mohite.