MySQL Reference Manual

Source: Internet
Author: User
Tags mysql slow query log

MySQL official reference manual Chinese version: http://dev.mysql.com/doc/refman/5.1/zh/index.html
Two analysis solutions for MySQL slow query: http://www.bitscn.com/pdb/mysql/201006/186917.html
MySQL slow query log: http://blog.chinaunix.net/u/9817/showart_1093402.html

Common commands

Backup and recovery
Backup Database: mysqldump.exe-u user name-P Password Database Name> Backup file address -- default-character-set = GBK
Recover Database: mysql-u username-P Password Database Name <backup file address -- default-character-set = GBK

Add Remote Account

Grant all privileges on *. * To 'myusername' @ '%' identified by 'mypassword' with grant option;

Index

Create an index: alter table table_name add primary key (column_list );
Alter table table_name add index index_name (column_list );

Create index index_name on table_name (column_list );
Create unique index index_name on table_name (column_list)

Delete index: drop index index_name on talbe_name;
Alter table table_name drop index index_name;
Alter table table_name drop primary key;

Good Method

Group_concat is a powerful MySQL method.
Select group_concat (gameid) from cm_games Concatenates the gameid field in the cm_games table into a string. Each value is separated

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.