MySQL Learning 4:windows 64-bit operating system using MySQL

Source: Internet
Author: User
Tags lowercase

All of the following steps are done using the command line to complete the operation of the MySQL service.

one start/close MySQL (1) Start MySQL service

net start MySQL


(2) Stop MySQL service

net stop MySQL


Two log in/out of MySQL

First, let's take a look at some important MySQL parameters, and some important MySQL parameters are listed in the following table:


(1) View version number

Enter Mysql-v or MySQL--version, note that the-V here is uppercase.


(2) log in to MySQL

MySQL will have to add parameters after the line. The format is: mysql-u root (user)-p-p port number-H mysql hostname \ip (Local machine loopback address). Such as

Input: Mysql-u root-p-P 3306-h 127.0.0.1, enter password after login;


If the command line is the native of MySQL, and with the default port of 3306, direct input: Mysql-u root-p, and then enter the password.


(3) MySQL exit

Enter any one of the following to exit the MySQL service.

mysql> exit;

Mysql> quit;

Mysql> \q (note here is the backslash);

Here I tried all three, can quit the MySQL service, the following is the input: exit;


Three modify MySQL prompt

Let's take a look at the prompt we often use:


Before you change, take a look at the default MySQL prompt:


(1) specify by parameter when connecting to client

The format is: Mysql-u root-p--prompt prompt, for example we input: Mysql-u root-p--prompt \h


(2) after connecting the client, modify by prompt command

The format is: Mysql>prompt prompt, for example we enter: Mysql>prompt \u, then enter again: Prompt \[email protected]\h \d>


Let's start by using the command to enter a database to see the results, input: use test;


four MySQL common commands (1) Show current server version

SELECT VERSION ();


(2) display the current date and time SELECT now ();
(3) Show current user

SELECT USER ();


Five MySQL statement specification

(1) The keyword and function name are all uppercase (even if written in lowercase, but in order to differentiate, the recommended keyword and function name all uppercase).

(2) Database name, table name, field name all lowercase.

(3) The SQL statement must end with a semicolon.



MySQL Learning 4:windows 64-bit operating system using 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.