MySQL Learning note One Open database operation

Source: Internet
Author: User

Open Databaseinput mysql-uroot-p in 1.cmd window2. Then prompt to enter the password3. If the MySQL server does not open error, you can use the following command to open the server
    • The server did not turn on the error prompt: 2003 (HY000): Can ' t connect to MySQL server on ' localhost ' (10061)
    • NET start mysql57 startup service
    • net stop mysql57 Service
    • Open manually inside the service settings
4. Configure the character format, find the following two lines in the My.ini text, add the corresponding character encoding later
    • [MySQL] After this add character encoding delete No-beep
Default-character-set=utf8
    • [Mysqld] Add character encoding after this
Character-set-server=utf85. Log in to MySQL
    • -U user Name
    • -p password
    • -H server name or port number (-H, followed by localhost/127.0.0.1)
    • -D Open the specified database
    • -V Output Version number

the parameters are written directly behind the code as shown below mysql-h127.0.0.1-uroot-p

quit MySQL
    • Exit
    • Quit
    • \q
6. Modify the command promptpromapt prompt: After connecting the client, modify by prompt command promapt \d database hint changed from mysql> symbol to display date parameter
    • \d Full Date
    • \d Current Database
    • \h Server Name
    • \u Current user Name
7. Common Commands
    • SELECT VERSION (); Show current version
    • SELECT now (); Show current Date Time
    • SELECT USER (); Show Current User

8. Statement specification

    • Keyword and function name all uppercase
    • Database name, table name, field name, and so on all lowercase
    • The SQL statement must end with a delimiter
    • The SQL statement supports wrap operations, so that you can continue writing on the next line as long as you don't split the simple, marked, or quotation marks into two parts
    • Database name, table name, field name and so on try not to use the MySQL reserved word, if need to use the use of anti-quotation marks ("') to enclose the name
9. Use the keyboard up and down to bring up previous commands10. Log Output
    • Output log \ t followed by path name save Operation command into text
\ t C:\Program files\mysql\mysql Server 5.7\1.txt
    • Stop output \ t

MySQL Learning note One Open database operation

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.