Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker images missing the mysqlimport binary #901

Closed
bryjohns opened this issue Aug 2, 2022 · 4 comments
Closed

Docker images missing the mysqlimport binary #901

bryjohns opened this issue Aug 2, 2022 · 4 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@bryjohns
Copy link

bryjohns commented Aug 2, 2022

I would like to use mysqlimport to load data for a project on a docker container. It appears the mysql docker images do not have that utility. I'm assuming mysqlimport is not part of the "mysql-community-server-minimal" package.

How would I add mysqlimport back to the image? Is there an image or option to use "mysql-community-server" instead of "mysql-community-server-minimal"?

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Aug 2, 2022
@wglambert
Copy link

This image has mysqlimport

$ docker run --rm mysql which mysqlimport
/usr/bin/mysqlimport

There's also an alternative way to import data (on first initialization) https://github.com/docker-library/docs/tree/master/mysql#initializing-a-fresh-instance

@bryjohns
Copy link
Author

bryjohns commented Aug 3, 2022

I'm using the following docker-compose file with docker version 20.10.17 on MacOs. I deleted the containers, images, and volumes and re-composed. I was using image tag mysql:5.7 and switched to mysql.

version: '3.3'

services:
   db:
     image: mysql
     volumes:
       - db_data:/var/lib/mysql
       - ./config/conf.d/:/etc/mysql/conf.d/
     restart: always
     ...

Which isn't installed on the image:
/usr/local/bin/docker-entrypoint.sh: line 400: exec: which: not found

When I click open in terminal from Docker Desktop:

sh-4.4# ls /usr/bin/mysql*
/usr/bin/mysql				/usr/bin/mysql_upgrade
/usr/bin/mysql-secret-store-login-path	/usr/bin/mysqladmin
/usr/bin/mysql_config			/usr/bin/mysqldump
/usr/bin/mysql_migrate_keyring		/usr/bin/mysqlpump
/usr/bin/mysql_ssl_rsa_setup		/usr/bin/mysqlsh
/usr/bin/mysql_tzinfo_to_sql

@tianon
Copy link
Member

tianon commented Aug 3, 2022

Looks like this might be another that's essentially a duplicate of #847 🙈

The best workaround is going to be switching explicitly to the Debian-based variants.

@bryjohns
Copy link
Author

bryjohns commented Aug 3, 2022

@tianon
Thank you! I see it there.

# ls /usr/bin/mysql*    
/usr/bin/mysql			    /usr/bin/mysqlcheck
/usr/bin/mysql_config_editor	    /usr/bin/mysqld_multi
/usr/bin/mysql_migrate_keyring	    /usr/bin/mysqld_safe
/usr/bin/mysql_secure_installation  /usr/bin/mysqldump
/usr/bin/mysql_ssl_rsa_setup	    /usr/bin/mysqldumpslow
/usr/bin/mysql_tzinfo_to_sql	    /usr/bin/mysqlimport
/usr/bin/mysql_upgrade		    /usr/bin/mysqlpump
/usr/bin/mysqladmin		    /usr/bin/mysqlshow
/usr/bin/mysqlbinlog		    /usr/bin/mysqlslap

@bryjohns bryjohns closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

3 participants