I have had install Damn small Linux(DSL) 10 in Virtual Box with MySQL 5. I created already a database with a Table and Data in it. I can access it over the terminal with the following line:

mysql -u dsl

During this, DSL is startes with startx (GUI). But if I start DSL without startx (its not anymore in .bash_profile) I'll get access to DSL over the Terminal (tty1) automatically.

The Problem at this point. If DSL started without startx, its not possible to get access to Mysql by give in the line:

mysql -u dsl

The Screenshot is here: enter image description here How its possible to solve this problem.

  • Not an answer to your question, but these days, VirtualBox+DSL is very often replaceable by a much lighter (and faster to start) Docker container. You'll find containers with MySQL pre-installed and other containers with an admin interface to it.
    – xenoid
    Commented Dec 7, 2017 at 23:06

3 Answers 3


That looks like a PATH issue. When you type a command name in the terminal like you do when typing mysql, actually the terminal is trying to find it in folder specified in the PATH variable, and I guess that variable doesn't contain the same folder when you're running X and when you are not.

When you are running with X, and you can use mysql, type whereis -b mysql, you should get something like /path/to/mysql or similar.

Then go into your no-X session and type that full path /path/to/mysql -u dsl and it should work.
To make it permanent you have to modify your .bash_profile if you are using bash. Write a line like this : export PATH='/path/to:$PATH and then from the command line . .bash_profile or reconnect yourself.


Assuming you don't need to do it regularly, the easiest way is to invoke mysql with the full path as

/usr/local/mysql/bin/mysql -u dsl

One possible option is to add


to your PATH by running

export PATH=$PATH;/usr/local/mysql/bin

else by adding this path to your ~/.bash_profile

But you can also type the whole path to mysql utility

/usr/local/mysql/bin/mysql -u dsl

By default installing Mysql it's not updating by anyway the PATH.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .