MySQL Common Operations Command

Source: Internet
Author: User

1, start the MySQL server

In fact, the previous article has talked about how to start MySQL. Two methods: First, with Winmysqladmin, if the machine is started automatically run, you can go directly to the next step. The second is to run in DOS mode
D:mysqlbinmysqld

2, access to the MySQL interactive operation interface

In DOS mode, run: d:mysqlbinmysql

Appears: The MySQL prompt, at this time has entered the MySQL interactive operation mode.

If "error 2003:can′t connect to MySQL server on′localhost′ (10061)" appears,

Shows that your MySQL has not yet started.

3, exit the MySQL operation interface

Enter quit at the mysql> prompt to exit the interactive interface at any time:

Mysql> quit

Bye

You can also use control-d to exit.

4. The first Order

Mysql> Select Version (), current_date ();

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

| Version () | Current_date () |

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

| 3.23.25a-debug | 2001-05-17 |

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

1 row in Set (0.01 sec)

Mysql>

This command requires the MySQL server to tell you its version number and current date. Try the above command in a different case to see what the results are. The results show that the case of the MySQL command is consistent.

Practice the following actions:

Mysql>select (20+5) *4;

Mysql>select (20+5) *4,sin (Pi ()/3);

Mysql>select (20+5) *4 as Result,sin (Pi ()/3); (as: Specify Kana as result)

Mysql> Select

-> USER ()

->,

-> Now ()

->;

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

| USER () | Now () |

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

| Odbc@localhost | 2001-05-17 22:59:15 |

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

1 row in Set (0.06 sec)

Mysql>

Notice how the middle comma and the last semicolon are used.

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.