0

i'm starting mysql containter docker run --name l4-mysql -e MYSQL_ROOT_PASSWORD=my-pass -p 3305:3306 -d mysql after i'm bash him docker exec -it l4-mysql bash need to edit mysqld.cnf file, but when i try use nano or vi i have error bash: nano: command not found bash: vi: command not found Other than that, I don't see the actual file in the directory /etc/mysql i have only another dir

bash-4.4# ls
conf.d

I tried to install nano inside bash (in ubuntu itself it is installed and working), I get an error

bash-4.4# apt install nano
bash: apt: command not found
  • (1) You can't install a software in a **shell**. You can only install it on a platform and then use it from a shell. (2) As you see from the error message, `apt` is not in your PATH. Try to specify the path to _apt_ explicitly. – user1934428 Mar 16 '23 at 11:38
  • @user1934428 nano working in ubuntu, but not working in bash – Forsaken_Oracle Mar 16 '23 at 11:40
  • 1
    _ubuntu_ is an operating system distribution, _bash_ is a shell. You are comparing apple with pears. What operating system is your bash running on? – user1934428 Mar 16 '23 at 11:43
  • @user1934428 Ubuntu 22.04 – Forsaken_Oracle Mar 16 '23 at 11:45
  • What does it mean that _nano does not work_? How do you run _nano_, and what response do you get? – user1934428 Mar 16 '23 at 11:46
  • This is about a Docker container. Depending on the base image, `apt` might be available or not. It is more likely that it is not and you need to use `apk` instead. The host operating system does not matter here. – knittl Mar 16 '23 at 11:46

1 Answers1

0

Mysql build the image with oracle linux so to install nano or vim you run the command

microdnf install nano sudo -y

and the location of my.cnf file is answered here the MySQL my.cnf location

athar
  • 16
  • 1