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 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

@darkmou5e darkmou5e commented Dec 12, 2014

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

@wmariuss
Copy link

@wmariuss wmariuss commented Dec 16, 2014

Good to know. Thanks.

@k2xl
Copy link

@k2xl k2xl commented Jan 15, 2015

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

@oskarmust
Copy link

@oskarmust oskarmust commented Jun 1, 2015

thanks, had the same issue with postgresql container and top

@mahnunchik
Copy link

@mahnunchik mahnunchik commented Jul 31, 2015

+1

@vladmiller
Copy link

@vladmiller vladmiller commented Aug 5, 2015

_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

@geraldvillorente
Copy link

@geraldvillorente geraldvillorente commented Aug 6, 2015

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 wmariuss commented Aug 6, 2015

Or .profile

@thanh-nguyen-van
Copy link

@thanh-nguyen-van thanh-nguyen-van commented Sep 1, 2015

thank you ! Nice to know that.

@hisapy
Copy link

@hisapy hisapy commented Sep 3, 2015

Hey guys, try the following to get a nicer top

export TERM=xterm

@denysvitali
Copy link

@denysvitali denysvitali commented Sep 18, 2015

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

Then logout and login again 👍

@anddan7
Copy link

@anddan7 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?

@zx1986
Copy link

@zx1986 zx1986 commented Oct 12, 2015

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

@federico-razzoli
Copy link

@federico-razzoli federico-razzoli commented Oct 22, 2015

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

@federico-razzoli
Copy link

@federico-razzoli federico-razzoli commented Oct 22, 2015

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

@simonmorley simonmorley commented Dec 20, 2015

+1

@Dan-Dongcheol-Lee
Copy link

@Dan-Dongcheol-Lee Dan-Dongcheol-Lee commented Jan 2, 2016

Thanks for the great tip!

@fthamura
Copy link

@fthamura fthamura commented Jan 3, 2016

any idea to fix this?

@geraldvillorente
Copy link

@geraldvillorente geraldvillorente commented Jan 3, 2016

@fthamura

$ echo "export TERM=dumb" >> ~/.bashrc
$ source ~/.bashrc
@lorenzop
Copy link

@lorenzop 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 kujiy commented Jan 7, 2016

+1 Thank you so much! @txthai

Why is this happened!

@amirabiri
Copy link

@amirabiri amirabiri commented Mar 30, 2016

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

docker exec -t db mysql < init.sql
@zburgermeiszter
Copy link

@zburgermeiszter zburgermeiszter commented Apr 7, 2016

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

@holyorb2 holyorb2 commented Apr 14, 2016

# TERM=xterm mysql

@geerlingguy
Copy link

@geerlingguy geerlingguy commented Sep 25, 2016

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

@justindurkin
Copy link

@justindurkin justindurkin commented Sep 29, 2016

@geerlingguy Thanks that's good news!

sebastian-luna-valero added a commit to CGATOxford/cgat that referenced this issue Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet