Environment Introduction
Os:centos6.x & Win2003 & Win2008
MySQL version number: 5.5.x
In addition to the frequently used MySQL management tools, there are also mysqlclient command-line tools that are often used
1.Linux Installing the command-line tool
1.Linuxclient Installation
(1). Enable the Epel Source:
(2). Install the MySQL command line tool
# # Yum-y Install MySQL
2. Command line frequently uses commands:
#mysql--help
3. How to output the host name in Mysqlclient. Database name,
#vi/etc/my.cnf
In the mysqlclient command adds for example the following
prompt = \\h\\[email protected]\\d \\r:\\m:\\s>
Explain the meaning:
\\h the host name of the database
\\u access to the database username said
\\d the default database name
\\r:\\m:\\s output time display in 24-hour time
> on behalf of MySQL command output symbol
References Link: https://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html
4. Instance syntax:
Mysql-u root-pxxxxx-h 127.0.0.1-p 23306
Mysql–uusername [–h host name or IP address]–ppassword
Description: Username is the user you are logged in to, the hostname or IP address is optional. The native connection is not writable, and the remote connection must write the IP address and port.
Note:
1. Lowercase-P is passwd, capital-P is port
2. Host name or IP address is optional. The native connection is not writable. Remote connection must write IP address and port
2.Windows under Client Installation
1. Download the free install version number. Choose to install only the client at the time of installation.
MySQL command line Login