MYSQL Tutorial: MYSQL operation_mysql

Source: Internet
Author: User
MYSQL Tutorial: If you are a beginner, you should check the MYSQL operation. if MYSQL runs on the server and you need to connect to the client, you need to connect as follows:

Shell> mysql-h host-u user-p

Enter password :************

Host and user indicate the host name and MySQL account name running on the MySQL server respectively. enter the name of the corresponding machine and the MySQL user name. ******** indicates your password.

If valid, you will see the following prompt:

Welcome to the MySQL monitor. Commands end with; or g.

Your MySQL connection id is 7 to server version: 5.0.18-nt

Type 'help; 'or 'H' for help. Type 'C' to clear the buffer.

Mysql>

Mysql> the prompt tells you to enter the command.

Sometimes MySQL allows you to log on to the server anonymously, and you can directly enter mysql.

Shell> mysql

After successful connection, you can enter quit at the mysql> prompt to exit at any time:

Mysql> quit

Bye

The following shows a simple query instance. this is a simple command that requires the server version number and current date:

Mysql> select version (), current_date;

+ ----------- + -------------- +

| Version () | current_date |

+ ----------- + -------------- +

| 5.0.18-nt | 2006-07-29 |

+ ----------- + -------------- +

1 row in set (0.00 sec)

Mysql>

Here we need to understand:

A command is usually composed of SQL statements followed by a semicolon.

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.