Get the App
SLTechnology News&Howtos  ›  Database  › 

Summary of Common commands in MySQL Database Management

Shulou Source: shulou.com Published: 2022-05-31 18:48:09 10月04日 Update

This article mainly explains "MySQL database management common command summary", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "MySQL database management common command summary"!

Install the Mysql using the RPM package and set up the iptables for port TCP 3306.

Root password management sets the password of the root user admin-uroot password password.

Change the password of the root user mysqladmin-uroot-p password password.

Database, table management enters mysqlmysql-h hostname-uroot-p.

Create the database mysql > create database location.

Import data structure mysql-uroot-p location show databases

Enter a library mysql > use location

View table information mysql > show tables

View the table structure mysql > desc Contact

Change the table name mysql > rename table Contact to Contact_new.

Delete the library mysql > drop database location.

Delete the table mysql > drop table Contact.

The authorization section establishes the user and authorizes mysql > grant all on location.* to gk1020@10.1.11.71 identified by gk1020.

Unauthorize mysql > revoke all on location.* from gk1020@10.1.11.71.

Refresh permissions mysql > flush privileges.

The operation statement queries mysql > select * from Contact.

Mysql > select count (*) from Contact.

Modify mysql > update Contact set RegTime='2008-01-01 00 where id=1.

Mysql > update Contact set RegTime='2008-01-01 00 where id=1.

Insert mysql > insert into Contact values (,...)

Mysql > insert into Contact (ID,CID,Contact) values (, …)

Delete mysql > delete from Contact where id=1.

Export the export database locationmysqldump-uroot-p location >. / location.sql.

Export a table mysqldump-uroot-p-- database location-- table Contact >. / contact.sql.

Export the data structure of database location, mysqldump-d-uroot-p location >. / location.sql.

The replication table Contact is Contact_bakmysql > create table Contact_bak as select * from Contact.

The structure of the replication table Contact is mysql > create table Contact_bak as select * from Contact where 1x2.

View the task mysql > show processlist that is being executed.

Thank you for your reading, the above is the "summary of common commands in MySQL database management", after the study of this article, I believe you have a deeper understanding of the problem of summarizing common commands in MySQL database management, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Data database management commands common use structure password user learning content data structure task information that is ideas situations articles more permissions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB Microsoft Xiaomi vpn