MySQL 5.7 Operation Command

Source: Internet
Author: User

Description
after the installation of the database, the following is used, the database command many, here only to operate a few simple commands, after all, too complicated to remember, I am very helpless ah. The database of the increase, deletion, change, check is necessary, but also some basic commands, and then do some examples.

Lab requirements: Centos7 install MySQL.

Let's do the authorization for the database. Remote Login
1. Mysql-u root-p #使用root用户登录数据库
Grant all privileges in . to ' root ' @ '% ' identified by ' qwe123 ' with GRANT option; #授权身份为root, the password is qwe123,% to allow all nets to log on, two asterisks for all databases and all tables


.
.
2. To know the virtual machine IP address of the installation database, use this IP for remote login

.
.
3. The example here is the host, open the host cmd command prompt interface, to ensure that the virtual machine can be interconnected with, you can ping, and then enter the command
Mysql-h 192.168.200.128-u Root-p


Remote Authorization Login Succeeded
.
.
Command operations to start the database below
.

1. First, add and view the database

.
.
2. Go to the database, create tables, view table structure operations

.
.

3. Insert data into the table and view the data in the table

.
.

4. Data unavoidable to change

.
.

5. Setting the primary key

.
.

6. Sort the data in a table

.
.

7. View the data for the specified row, and sum and average the results

.
.

8. Delete the primary key, delete the column, and view the results

.
.
9. Delete the table to see the results

.
.

10. Finally delete the database and view the results

.
.

A short operation, a lack of a lot to forgive

MySQL 5.7 Operation Command

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.