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

Comments

Projects
None yet
@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

@antonbz

This comment has been minimized.

Copy link

antonbz commented Dec 12, 2014

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

@wmariuss

This comment has been minimized.

Copy link

wmariuss commented Dec 16, 2014

Good to know. Thanks.

@k2xl

This comment has been minimized.

Copy link

k2xl commented Jan 15, 2015

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

@oskarmust

This comment has been minimized.

Copy link

oskarmust commented Jun 1, 2015

thanks, had the same issue with postgresql container and top

@mahnunchik

This comment has been minimized.

Copy link

mahnunchik commented Jul 31, 2015

+1

@vladmiller

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

wmariuss commented Aug 6, 2015

Or .profile

@thanh3d

This comment has been minimized.

Copy link

thanh3d commented Sep 1, 2015

thank you ! Nice to know that.

@hisapy

This comment has been minimized.

Copy link

hisapy commented Sep 3, 2015

Hey guys, try the following to get a nicer top

export TERM=xterm

@denysvitali

This comment has been minimized.

Copy link

denysvitali commented Sep 18, 2015

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

Then logout and login again 👍

@anddan7

This comment has been minimized.

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?

@zx1986

This comment has been minimized.

Copy link

zx1986 commented Oct 12, 2015

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

@federico-razzoli

This comment has been minimized.

Copy link

federico-razzoli commented Oct 22, 2015

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

@federico-razzoli

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

simonmorley commented Dec 20, 2015

+1

@Dan-Dongcheol-Lee

This comment has been minimized.

Copy link

Dan-Dongcheol-Lee commented Jan 2, 2016

Thanks for the great tip!

@fthamura

This comment has been minimized.

Copy link

fthamura commented Jan 3, 2016

any idea to fix this?

@geraldvillorente

This comment has been minimized.

Copy link

geraldvillorente commented Jan 3, 2016

@fthamura

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

kujiy commented Jan 7, 2016

+1 Thank you so much! @txthai

Why is this happened!

@amirabiri

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

holyorb2 commented Apr 14, 2016

# TERM=xterm mysql

@geerlingguy

This comment has been minimized.

Copy link

geerlingguy commented Sep 25, 2016

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

@justindurkin

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.