Question

I just installed mysql from binary files on ubuntu, the server starts and I can access the sql command window.

However when running commands from mysql bin folder like mysqladmin, mysql_secure_installation... it keeps saying "command not found" ... Is it related to environment variable path?

This is the path of I have in the /etc/environment file

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/mysql/bin"

any idea?

Pascal

Was it helpful?

Solution 2

Enter the following command with correct username and password

mysql -u USER -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"'

Output (on Linux) will be like this:

+---------------------------+----------------------------+
| Variable_name             | Value                      |
+---------------------------+----------------------------+
| basedir                   | /usr                       |
| character_sets_dir        | /usr/share/mysql/charsets/ |
| datadir                   | /var/lib/mysql/            |
| innodb_data_home_dir      |                            |
| innodb_log_group_home_dir | ./                         |
| lc_messages_dir           | /usr/share/mysql/          |
| plugin_dir                | /usr/lib/mysql/plugin/     |
| slave_load_tmpdir         | /tmp                       |
| tmpdir                    | /tmp                       |
+---------------------------+----------------------------+

You can find the required directory.

OTHER TIPS

In Ubuntu, if you have installed from apt-get you will get from:

$ whereis mysql
$ mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/bin/X11/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

MySQL must be in /usr/bin/mysql

Post the output from file /usr/bin/mysql

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top