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

"TERM environment variable not set." when executing "mysql" in container #3

Open
txthai opened this issue Nov 5, 2014 · 27 comments
Open

Comments

@txthai
Copy link

txthai commented Nov 5, 2014

docker exec -it mariadb bash
mysql
produces the following error message: TERM environment variable not set.

Unsure why since echo $TERM returns dumb and issuing export TERM=dumb resolves issue.

If the environment variable is explicitly issued in the dockerfile, the error message never appears, i.e. adding ENV TERM dumb

@darkmou5e
Copy link

I have same problem. txthai, thank you for solution!

@wmariuss
Copy link

Good to know. Thanks.

@k2xl
Copy link

k2xl commented Jan 15, 2015

LOL I had this issue too, thanks for the tip.

@oskarmust
Copy link

thanks, had the same issue with postgresql container and top

@mahnunchik
Copy link

+1

@vladmiller
Copy link

_CoreOS stable (723.3.0)_ unfortunately your solution doesn't work 😫

_UPD:_ Ok, I was actually able to ssh to a container

docker run -it mariadb_container bash

and then inside set TERM variable

@iamstoick
Copy link

export TERM=dumb works great but the issue returns once you reboot or restart the VM. To make is permanent I guess you need to put export TERM=dumb in ~/.bashrc or similar files.

@wmariuss
Copy link

wmariuss commented Aug 6, 2015

Or .profile

@thanh-nguyen-van
Copy link

thank you ! Nice to know that.

@hisapy
Copy link

hisapy commented Sep 3, 2015

Hey guys, try the following to get a nicer top

export TERM=xterm

@denysvitali
Copy link

Better way:
echo "export TERM=dumb" >> ~/.bashrc

Then logout and login again 👍

@anddan7
Copy link

anddan7 commented Sep 18, 2015

Tried to run an image of ownCloud and ran into this exact problem. running export TERM=dumb does get rid of the error message however commands like clear and top doesn't seem to work.

Running export TERM=xterm did the trick though, anyone care to explain why?

@denysvitali
Copy link

@anddan7 http://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables

@zx1986
Copy link

zx1986 commented Oct 12, 2015

@txthai WOW! it works perfect! thank you so much!
export TERM=dumb

@federico-razzoli
Copy link

I had the same problem after installing MariaDB 10.1 on official debian image, tag "jessie".

@federico-razzoli
Copy link

On a Debian container, when I run this:

apt-get install software-properties-common

I get a long output with these lines:

Setting up unattended-upgrades (0.83.3.2+deb8u1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline

Hope this helps.

@simonmorley
Copy link

+1

@Dan-Dongcheol-Lee
Copy link

Thanks for the great tip!

@fthamura
Copy link

fthamura commented Jan 3, 2016

any idea to fix this?

@iamstoick
Copy link

@fthamura

$ echo "export TERM=dumb" >> ~/.bashrc
$ source ~/.bashrc

@lorenzop
Copy link

lorenzop commented Jan 7, 2016

This in the Dockerfile works. Setting it to xterm rather than dumb also fixed the clear command.

RUN echo -e "\nexport TERM=xterm" >> ~/.bashrc

@kujiy
Copy link

kujiy commented Jan 7, 2016

+1 Thank you so much! @txthai

Why is this happened!

@amirabiri
Copy link

There is still a problem if you try to do something like:

docker exec -t db mysql < init.sql

@zburgermeiszter
Copy link

This worked for me:
https://gist.github.com/zburgermeiszter/89a41467c80327c0bb550a2c7077d747
docker exec -i CONTAINER_ID /bin/bash -c "export TERM=xterm && mysql -proot -uroot database" < import.sql

@holyorb2
Copy link

# TERM=xterm mysql

@geerlingguy
Copy link

This will be fixed in Docker 1.13, FYI: moby/moby#26461

@justindurkin
Copy link

@geerlingguy Thanks that's good news!

sebastian-luna-valero added a commit to CGATOxford/cgat that referenced this issue Apr 19, 2017
wesdevpro added a commit to wesdevpro/CS326-Scheduler that referenced this issue Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests