Log_success_msg command not found

Each conforming init script shall source the file /lib/lsb/init-functions. This file shall cause the following shell script commands to be defined in an unspecified manner.

Note: This can be done either by adding a directory to the PATH variable which defines these commands, or by defining shell aliases.

Although the commands made available via this mechanism need not be conforming applications in their own right, applications that use them should only depend on features described in this specification.

Conforming scripts shall not specify the "exit on error" option (i.e. set -e) when sourcing this file, or calling any of the commands thus made available.

The start_daemon, killproc and pidofproc functions shall use the following algorithm for determining the status and the process identifiers of the specified program.

  1. If the -p pidfile option is specified, and the named pidfile exists, a single line at the start of the pidfile shall be read. If this line contains one or more numeric values, separated by spaces, these values shall be used.

  2. Otherwise, /var/run/basename.pid shall be read in a similar fashion. If this contains one or more numeric values on the first line, these values shall be used.

  3. Optionally, if neither of the above methods has determined the process identifiers required, implementations may use unspecified additional methods to locate the process identifiers required.

The method used to determine the status is implementation defined, but should allow for non-binary programs.

Note: Commonly used methods check either for the existence of the /proc/pid directory or use /proc/pid/exe and /proc/pid/cmdline. Relying only on /proc/pid/exe is discouraged since this specification does not specify the existence of, or semantics for, /proc. Additionally, using /proc/pid/exe may result in a not-running status for daemons that are written in a script language.

Conforming implementations may use other mechanisms besides those based on pidfiles, unless the -p pidfile option has been used. Conforming applications should not rely on such mechanisms and should always use a pidfile. When a program is stopped, it should delete its pidfile. Multiple process identifiers shall be separated by a single space in the pidfile and in the output of pidofproc.

start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...]

runs the specified program as a daemon. The start_daemon function shall check if the program is already running using the algorithm given above. If so, it shall not start another copy of the daemon unless the -f option is given. The -n option specifies a nice level. See nice. start_daemon shall return the LSB defined exit status codes. It shall return 0 if the program has been successfully started or is running and not 0 otherwise.

killproc [-p pidfile] pathname [signal]

The killproc function shall stop the specified program. The program is found using the algorithm given above. If a signal is specified, using the -signal_name or -signal_number syntaxes as specified by the kill command, the program is sent that signal. Otherwise, a SIGTERM followed by a SIGKILL after an unspecified number of seconds shall be sent. If a program has been terminated, the pidfile should be removed if the terminated process has not already done so. The killproc function shall return the LSB defined exit status codes. If called without a signal, it shall return 0 if the program has been stopped or is not running and not 0 otherwise. If a signal is given, it shall return 0 only if the program is running.

pidofproc [-p pidfile] pathname

The pidofproc function shall return one or more process identifiers for a particular daemon using the algorithm given above. Only process identifiers of running processes should be returned. Multiple process identifiers shall be separated by a single space.

Note: A process may exit between pidofproc discovering its identity and the caller of pidofproc being able to act on that identity. As a result, no test assertion can be made that the process identifiers returned by pidofproc shall be running processes.

The

C:\Program Files\MySQL\MySQL Server 8.0\bin
3 error occurs because your computer can’t find a program associated with the command on your computer’s
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 environment variable.

$ mysql
-bash: mysql: command not found

The

C:\Program Files\MySQL\MySQL Server 8.0\bin
4 environment variable is a list of directories specifying where your computer should look for a program to run from the Terminal.

When you execute the

C:\Program Files\MySQL\MySQL Server 8.0\bin
6 command from the Terminal, your computer will look through all the folders listed under
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 variable to find the
C:\Program Files\MySQL\MySQL Server 8.0\bin
6 executable file and pass your commands to it.

The way to fix the error is to add MySQL

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder to your
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 environment variable, but where the
C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder is located will be different depending on the Operating System you used on your Computer.

This tutorial will help you fix the error for Windows, macOS and Linux-based Operating Systems. Let’s start with Windows first.

Fix mysql command not found error in Windows

If you’re using Windows OS on your Computer, MySQL

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder is usually located on
D:\XAMPP\mysql\bin
3 drive as shown below:

C:\Program Files\MySQL\MySQL Server 8.0\bin

MySQL appends the installed version on the folder name, so if you installed another version of the MySQL server, then your path should have the version in the path as well.

For version 7, the path becomes

D:\XAMPP\mysql\bin
4

Now the path above is only valid when you install MySQL using the official MySQL installer.

If you install MySQL using third-party applications like XAMPP or WAMP, then the location of the

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder may be different.

For XAMPP, it may be located on

D:\XAMPP\mysql\bin
6 folder as follows:

D:\XAMPP\mysql\bin

You need to check your Computer to find the actual folder location.

Once you find your

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder location, use the following steps to add the folder to your
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 environment variable:

Go to My Computer or This PC for Windows 10. Right-click on empty space and open the Properties window:

Click on Properties from My Computer or This PC screenClick on Properties from My Computer or This PC screen

Click Advanced system settings from the left bar of the Properties window:

Click Advanced system settings from PropertiesClick Advanced system settings from Properties

Now you’re in the System Properties window. Click the

D:\XAMPP\mysql\bin
9 button:

Click on Environment Variables from System PropertiesClick on Environment Variables from System Properties

Now you’re in the Environment Variables window. Select the

$ mysql --version
mysql  Ver 8.0.26 for Win64 on x86_64 (MySQL Community Server - GPL)
0 variable from either the User Variables or System Variables table and click on the
$ mysql --version
mysql  Ver 8.0.26 for Win64 on x86_64 (MySQL Community Server - GPL)
1 button:

Edit the Path variable from Environment Variables windowEdit the Path variable from Environment Variables window

At the end of the variable values, add

$ mysql --version
mysql  Ver 8.0.26 for Win64 on x86_64 (MySQL Community Server - GPL)
2 as a new entry to your
$ mysql --version
mysql  Ver 8.0.26 for Win64 on x86_64 (MySQL Community Server - GPL)
0 variable:

Adding the MySQL executable folder location to Path variableAdding the MySQL executable folder location to Path variable

Don’t forget to adjust the location of the

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder if you’re using third-party installers.

Please enter the absolute path from the drive letter to your MySQL program’s

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder.

Once done, click

$ mysql --version
mysql  Ver 8.0.26 for Win64 on x86_64 (MySQL Community Server - GPL)
6 and open a new Terminal or Command Line window. If you’re calling
C:\Program Files\MySQL\MySQL Server 8.0\bin
6 from the VSCode terminal, you need to restart VSCode first before trying again.

The

C:\Program Files\MySQL\MySQL Server 8.0\bin
6 command not found error should be fixed and you should be able to check this using the
$ mysql --version
mysql  Ver 8.0.26 for Win64 on x86_64 (MySQL Community Server - GPL)
9 command:

$ mysql --version
mysql  Ver 8.0.26 for Win64 on x86_64 (MySQL Community Server - GPL)

And that’s how you fix the error on Windows.

Fix mysql command not found error in macOS

On macOS, you should be able to use

C:\Program Files\MySQL\MySQL Server 8.0\bin
6 command once you installed MySQL using the official macOS installer or Homebrew.

If you find the command not found error, then you need to manually add the

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder to your
/usr/local/Cellar/mysql/8.0.26/bin
2 or
/usr/local/Cellar/mysql/8.0.26/bin
3 file if you use ZSH command line client.

If you’re installing MySQL using the official installer, then your MySQL

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder should be located on
/usr/local/Cellar/mysql/8.0.26/bin
5

But if you installed MySQL using Homebrew, then the

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder may be located in the
/usr/local/Cellar/mysql/8.0.26/bin
7 folder as shown below:

/usr/local/Cellar/mysql/8.0.26/bin

The most recent version of Homebrew installation will automatically create a symlink from

/usr/local/Cellar/mysql/8.0.26/bin
5 to the
/usr/local/Cellar/mysql/8.0.26/bin
9 folder.

But if you still can’t run

C:\Program Files\MySQL\MySQL Server 8.0\bin
6 command, then you need to add the
C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder to the
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 variable manually.

To add

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder to the
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 variable, open your
/usr/local/Cellar/mysql/8.0.26/bin
2 or
/usr/local/Cellar/mysql/8.0.26/bin
3 file and append the following
export PATH=/usr/local/Cellar/mysql/8.0.26/bin:$PATH
7 statement on the last line:

export PATH=/usr/local/Cellar/mysql/8.0.26/bin:$PATH

You need to adjust the

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder location above to your Computer’s actual location.

Now you should be able to run

C:\Program Files\MySQL\MySQL Server 8.0\bin
6 commands from Mac’s Terminal.

Fix mysql command not found error in Linux

When you’re using a Linux-based Operating System like Ubuntu, the mysql command not found error usually comes with a guide to install the

$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-8.0     # version 8.0.26-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3  # version 1:10.3.31-0ubuntu0.20.04.1
0 application as shown below:

$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-8.0     # version 8.0.26-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3  # version 1:10.3.31-0ubuntu0.20.04.1

You just need to follow the instructions and install one of the two packages above. I recommend you use the official

$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-8.0     # version 8.0.26-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3  # version 1:10.3.31-0ubuntu0.20.04.1
0 package.

The

$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-8.0     # version 8.0.26-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3  # version 1:10.3.31-0ubuntu0.20.04.1
2 package is for MariaDB database platform, which is a fork of MySQL.

Install the package using the

$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-8.0     # version 8.0.26-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3  # version 1:10.3.31-0ubuntu0.20.04.1
3 command as shown below:

sudo apt install mysql-client-core-8.0

You will be asked for your root password. Once the installation is completed, you should be able to run

C:\Program Files\MySQL\MySQL Server 8.0\bin
6 commands from the Terminal:

$ mysql --version
mysql  Ver 8.0.26-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))

If you already installed

$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-8.0     # version 8.0.26-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3  # version 1:10.3.31-0ubuntu0.20.04.1
0 package but still found the MySQL command not found error, then your MySQL
C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder path may not be added to your
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 variable yet.

To fix the error, you can try to uninstall

$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-8.0     # version 8.0.26-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3  # version 1:10.3.31-0ubuntu0.20.04.1
0 package first:

sudo apt remove mysql-client-core-8.0

Then install it again:

sudo apt install mysql-client-core-8.0

If the error still appears, then you need to manually add the MySQL

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder to your
C:\Program Files\MySQL\MySQL Server 8.0\bin
4 variable.

You need to check manually where the

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder is located. It’s commonly located in
sudo apt install mysql-client-core-8.0
2 or
sudo apt install mysql-client-core-8.0
3.

Once you find the

C:\Program Files\MySQL\MySQL Server 8.0\bin
9 folder, navigate to your home directory from the Terminal and open your
/usr/local/Cellar/mysql/8.0.26/bin
2 file using a text editor like
sudo apt install mysql-client-core-8.0
6:

How do I fix MySQL not found Mac?

Open macOS system preferences and select the MySQL preference panel, and then execute Start MySQL Server. Or, manually load the launchd file. To configure MySQL to automatically start at bootup, you can: $> sudo launchctl load -w com.

Why MySQL command is not working?

The mysql Command not found error occurs because your computer can't find a program associated with the command on your computer's PATH environment variable. The PATH environment variable is a list of directories specifying where your computer should look for a program to run from the Terminal.

How do I open MySQL console?

Launch the MySQL Command-Line Client. To launch the client, enter the following command in a Command Prompt window: mysql -u root -p . The -p option is needed only if a root password is defined for MySQL. Enter the password when prompted.

How do I check MySQL version?

To check the version your MySQL is running, type and execute mysql -V (note the uppercase V) in the command line.