MySQL Error: the solution of command not found

When building zrlog under Tomcat architecture, MySQL will report an error. As follows:

When entering the MySQL command

Error report

# mysql: command not found
   This command does not exist

When restarting MySQL service

# /etc/init.d/mysqld restart

Error report

# mysqld_safe A mysqld process already exists


First # PS aux | grep grep , and then # kill - 9 PID , kill MySQL related processes, no, report an error

First # kill MySQL , and then restart, or not, report an error

Modify the/etc/my.cnf file, clear the relevant rules, restart mysql, or not


MySQL is clearly installed and running normally. How can this problem occur

Method 1 (palliative treatment)

Run the command as an absolute path. For example, my native path is /usr/local/MySQL/bin/MySQL

# /usr/local/mysql/bin/mysql restart

Method 2 (cure the root cause)

# ln -s /usr/local/mysql/bin/mysql /usr/bin

It is equivalent to creating a linked file- S for soft link

# mysql -uroot -p

Similar Posts: