Hello,
I am practicing DO180 session 3.6 (Loading the Database) on the RHEL Linux virtual machine under VirtualBox. After executing the following "podman run -d ..." command, I encountered failure when run the "mysql -uuser1 -h 127.0.0.1 -pmypa55 -P13306 items < /home/student/DO180/labs/manage-networking/db.sql" command. The failure message is: "bash: mysql: command not found...".
But when run on DO180 Lab environment, it works fine.
podman run --name mysqldb-port -d -v /home/student/local/mysql:/var/lib/mysql/data -p 13306:3306 -e MYSQL_USER=user1 -e MYSQL_PASSWORD=mypa55 -e MYSQL_DATABASE=items -e MYSQL_ROOT_PASSWORD=r00tpa55 registry.redhat.io/rhel8/mysql-80:1
What's wrong with my VirtualBox RHEL Linux environment ? Thanks for any advice.
Hi Marek,
Thank you very much. I SSHed to another VBox Linux (CentOS
Close.
Best regards,
jonawang
Hi @jonawang,
You are missing the mysql command. I am not sure which RHEL version you use, but on my Fedora, I can search what packages provide the mysql command by using yum whatprovides $PACKAGE_NAME, for example:
If I install one of those packages, I can use the mysql command. You can find community repositories here, and you can download the mysql binary directly here.
If you want to practice your container knowledge and abilities, you could even use a second mysql container to connect to the first one! I will leave that up to you though ;).
M.
Hi Marek,
Thanks for the feedback. I am trying to run mysql on podman container using the image pulled down from registry.redhat.io/rhel8, as the command shows:
My Linux version is RHEL 8.5. I checked the PATH, both the Lab Env. and my VB RHEL are the same. The image sources are the same, too.
So I am thinking what else I missed in the environment setting ?
Sure, but if you are using your own RHEL, then you don't have the mysql command installed. The mysql client does not come pre-installed with RHEL, we installed it on the workstation machine, hence why I included steps on how to install in in my previous comment.
Hi Marek,
Thank you very much. I SSHed to another VBox Linux (CentOS
Close.
Best regards,
jonawang
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.