Example of MySQL command line login

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

Environment: MySQL Sever 5.1 + MySQL command line tool

Problem: MySQL command line login

Solve:

command-line logon syntax:

Mysql–u username [–h host name or IP address]–p password

Description: User name is the user you login, host name or IP address is optional, if it is a local connection is not required, remote connection needs to fill in, the password is the corresponding user's password.

Attention:

1. The command is executed under the Windows Command Line window, not the MySQL command line;

2. Input-P can be directly followed by the password, you can also press the return, will prompt you to enter the password, both are the same effect;

3.–p password option is not necessarily to be at the end;

4.–u,-H,-p after no space.

Example:

--Local connection  
mysql–uroot-p  
--Remote connection  
mysql–uwgb–hxxx.xxx.xxx.xxx–p

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/

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.