MySQL command line Login

Source: Internet
Author: User
Tags mysql version mysql command line

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

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.