#mysql: Command not found

Source: Internet
Author: User

First, the problem description

1, Linux has been installed in MySQL, through the #ps-ef |grep MySQL can show that MySQL has been started, but to go to the MySQL command page, the following problems appear:

1 [[email protected] ~] - P 2 -  not found   

Find out if MySQL is already started

1 [[email protected] ~]# PS-Ef|grep MySQL2Root1172     1  0  -: -?xx:xx:xx /Bin/Sh/Usr/Local/Mysql/Bin/Mysqld_safe--Datadir=/service/mysql--pid-file=/service/mysql/root.pid3Mysql1285  1172  9  -: -?xx:xx: on /Usr/Local/Mysql/Bin/Mysqld--basedir=/usr/local/mysql--datadir=/service/mysql--plugin-dir=/usr/local/mysql/lib/plugin--user=mysql-- Log-error=/service/mysql/root.err--pid-file=/service/mysql/root.pid4Root1440  1288  0  -: -Pts/1    xx:xx:xxgrep MySQL
2, find the cause of the problem:

Cause: This is because the system will find the command under/usr/bin by default, if this command is not in this directory, of course, will not find the command, we need to do is to map a link to the/usr/bin directory, equivalent to create a link file.
First you need to know the full path of the MySQL command or mysqladmin command, such as the path to MySQL is:/usr/local/mysql/bin/mysql, "This path is the actual MySQL installation path" We can execute the command

1 [[email protected] bin] - /usr/local/mysql/bin//usr/bin/
3. Connect MySQL
1 [[email protected] bin]# MySQL-U-P2Welcome toThe MySQL Monitor. CommandsEnd  with;or\g.3Your MySQL Connection ID is 14Server version:5.6. -Source Distribution5 6Copyright (c) -, the, Oracleand/orits affiliates. Allrights reserved.7 8Oracle isA registered trademark ofOracle Corporationand/or its9Affiliates. Names May trademarks oftheir respectiveTen owners. One  AType'Help ;' or '\h'  forHelp. Type'\c'  toClear the Currentinput statement. -  -Mysql>Ctrl-C--exit! theAborted



#mysql: Command not found

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.