Mysql learns to use Mysql_mysql under Windows 64-bit system on the fourth day

Source: Internet
Author: User
Tags lowercase mysql host port number

First, start/close MySQL

(1) Start MySQL service:net start MySQL


(2) Stop MySQL service: net stop MySQL


Second, login/exit MySQL

First we take a look at some important MySQL parameters, the following table lists some of the important MySQL parameters:


(1) View version number : Enter Mysql-v or MySQL--version, note that here is the uppercase-V.


(2) Login MySQL

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

such as input: Mysql-u root-p-P 3306-h 127.0.0.1, enter password login after entering;


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


(3) MySQL exit

Enter any of the following to exit the MySQL service.

Mysql> exit;

Mysql> quit;

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

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


Third, modify the MySQL prompt

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


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


(1) specifying by parameter when connecting to the client

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


(2) After connecting to the client, through the prompt command to modify

The format is: Mysql>prompt prompt, for example we enter: Mysql>prompt \u, then enter again: Prompt \u@\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) display the current server version : SELECT version ();


(2) display the current date time: SELECT now ();

(3) display the current user : SELECT user ();


Five, the MySQL statement specification

(1) Keywords and function names are all capitalized (even if written in lowercase, but for distinction, the recommended keyword and function names are all uppercase).

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

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

The above is the entire content of this article, I hope to help you learn.

Related articles:

MySQL Learn the first day of contact with MySQL first time

MySQL Learn the next day install and configure MySQL Winx64

MySQL learning the third day under Windows 64-bit operating system to authenticate MySQL

Thank you for your reading, small knitting will make unremitting efforts!

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.