MySQL basic operation and Syntax specification

Source: Internet
Author: User
Tags mysql login server port

1.mysql is an open-source relational database management system.
2.mysql Login/exit: MySQL parameter: mysql-u root-p-p3306-h127.0.0.1
3.mysql Landing some parameters meaning:-u: User name,-P: User password,-P: Server port number,-H: Server address-D: Specify the name of the database to open
4.mysql exit three kinds of commands: exit;,quit;,\q;
5. How to modify the MySQL prompt: mysql-uroot-p password depends on the situation--prompt. The second method is: When you enter MySQL, you can enter prompt directly and add the prompt you want to change.
6.mysql prompt type: \d: Represents the full date \d: Represents the current database \h: Name of the server \u: Current user
7.mysql common commands and Syntax rules: SELECT version ();: Displays the current server versions. SELECT Now (): Displays the current date time. SELECT user ();: Show Current user
Syntax specification: the keyword and function name are all capitalized. Database name, table name, field name all lowercase. The SQL statement must end with a semicolon.
8. A semicolon is a terminator.
9. Creating the database: Create databases db_name; Show all databases: show DATABASES; Displays the encoding of the database: show CREATE database db_name; Displays the warning information for the databases: show WARNINGS;
10. How to modify the database encoding method when creating the database: Create DB IF not EXISTS db_name CHARACTER SET encoding method;
11. Delete databases: drop database db_name;

MySQL basic operation and Syntax specification

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.