A CentOS-based MySQL learning supplement

Source: Internet
Author: User

Export the SQL script for a database in a MySQL database-that is, the structure and data of the database are imported into an SQL script, which can then be recovered by the SQL script.

Mysqldump-u MySQL (user name: mysql)-pmysql (password: mysql) p2pserver (database name: p2pserver) > P2pserver.sql (script name: p2pserver.sql)

If you need to export all of your database scripts

<pre name= "code" class= "plain" ><pre name= "code" class= "CPP" >mysqldump-u MySQL (user name: mysql)-pmysql (password: MySQL)-A > P2pserver.sql (file name: p2pserver.sql)


This is the SQL statement inside about Wp_users:

DROP TABLE IF EXISTS ' wp_users ';/*!40101 set @saved_cs_client     = @ @character_set_client */;/*!40101 Set Character_set _client = UTF8 */; CREATE TABLE ' wp_users ' (  ' ID ' bigint () unsigned not null auto_increment,  ' user_login ' varchar ($) NOT NULL DEFA ULT ',  ' user_pass ' varchar ($) NOT null default ' ',  ' user_nicename ' varchar (') ', ' "NOT null Default ' ',  ' user_e Mail ' varchar ' NOT null default ',  ' user_url ' varchar (+) NOT null default ' ',  ' user_registered ' datetime NO T null default ' 0000-00-00 00:00:00 ',  ' user_activation_key ' varchar (NOT null default ' ',  ' user_status ' int ( One) not null default ' 0 ',  ' display_name ' varchar (+) NOT null default ' ',  PRIMARY key (' ID '),  key ' User_lo Gin_key ' (' User_login '),  key ' user_nicename ' (' user_nicename ')) Engine=myisam auto_increment=3 DEFAULT charset= utf8;/*!40101 SET character_set_client = @saved_cs_client */;
What do the two keywords for primay key and key mean?

Primay key is the primary key to ensure the uniqueness of the data;

Key is an index constraint that constrains the index of a field in a table, with the common foreign key. Key is a keyword that is unique across all records in a table and can be omitted from ordinary tables. If this keyword is set, queries are accelerated when querying the table, but additional burdens are added.



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

A CentOS-based MySQL learning supplement

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.