How to enter the MySQL Command Line in Linux

Source: Internet
Author: User
Connect to MySQL: Format: mysql-h host address-u user name-p User Password 1, Example 1: connect to MYSQL on the local machine to find the mysql installation directory, generally you can directly type

Connect to MySQL: Format: mysql-h host address-u user name-p User Password 1, Example 1: connect to MYSQL on the local machine to find the mysql installation directory, generally you can directly type

Connect to MySQL:

Format: mysql-h host address-u user name-p User Password

1. Example 1: connect to MYSQL on the local machine

Find the installation directory of mysql. Generally, you can directly enter the mysql-uroot-p command, and press enter to prompt you to enter the password. If you have just installed MYSQL, the Super User root has no password, so press enter to enter MYSQL. The MYSQL prompt is: mysql>

2. Connect to MySQL on the remote host

Assume that the IP address of the remote host is 10.0.0.1, the user name is root, and the password is 123. Enter the following command:

Mysql-h10.0.0.1-uroot-p123

(Note: you do not need to add spaces for u and root. The same applies to others)

3. Exit MySQL Command

Exit (Press ENTER)

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.