The first two days when you encountered data recovering data with the source command, the prompt package was too big an error. That package Mymanager exported, this time with MySQL with the Mysqldump tool successfully exported and imported into the
In MySQL, the definition time of the slow query is specified by the mysql built-in parameter variable long_query_time, its default value is 10 (in seconds), we can show variables like ' long_query_time '; Directive to view the information for this
mysq Index Type: normal index, unique index and primary index
1. General Index
The only task for a normal index (indexed by the keyword Key or index) is to speed access to the data. Therefore, only those that appear most frequently in the query
MySQL master copy
How to install MySQL database, here do not say, only to say that its master-slave copy, the steps are as follows:
1, the master-slave server for the following operations:1.1, consistent version1.2, initialization of the table,
Truncate usage
TRUNCATE [TABLE] Tbl_name
I want to delete all the records in the Friends table, you can use the following statement:
TRUNCATE TABLE friends;
Delete Usage
DELETE [low_priority] [QUICK] [IGNORE] from Tbl_name[WHERE
The basic syntax for the CREATE TABLE statement in MySQL is:
The code is as follows
Copy Code
CREATE [temporary] TABLE [IF not EXISTS] tbl_name [(create_definition,...)][Table_options] [Select_statement]
ALTER TABLE table_name AUTO_INCREMENT=N;Note that n can only be greater than an integer value of an existing auto_increment, and less than the value is invalid.Show table status like ' table_name ' can see auto_increment this column is a performance
1. Copy table structure and data to new table
CREATE Table New Table SELECT * from old tableThis method copies all the contents of the oldtable, and of course we can delete them with the delete from newtable.
But one of the worst aspects of this
The principle of master copy of database:The master-slave copy of the database is replicated from the master database to the slave database, and three threads are required to implement the entire replication between master and slave, of which two
(1) MySQL replace functionSyntax: replace (object,search,replace)Replaces all occurrences of search in object with replace
The code is as follows
Copy Code
Update ' News ' Set ' content ' =replace (' content ', ', ', ')//
SQL Category:ddl-Data Definition language (create,alter,drop,declare)dml-Data Manipulation Language (Select,delete,update,insert)dcl-Data Control Language (Grant,revoke,commit,rollback)
First, briefly introduce the underlying statement:1,
1.1 Get Current date + time (date + times) function: Now ()
Mysql> Select Now ();
+---------------------+| Now () |+---------------------+| 2008-08-08 22:20:46 |+---------------------+ In addition to the now () function to get the current date
The code is as follows
Copy Code
SELECT * FROM Test_infointo outfile '/tmp/test.csv 'Fields terminated by ', ' optionally enclosed by ' "' escaped by '" 'Lines terminated by ' RN ';
To import CSV format data in MySQL:
Mysqlslap is an official MySQL-provided stress testing tool starting with version 5.1.4. Perform stress testing by simulating multiple concurrent client access to MySQL while providing detailed data performance reports for "High load attack MySQL".
1. IntroductionIn the Web application architecture, the data persistence layer (usually a relational database) is a key core part that has a very important impact on the performance of the system. MySQL is currently the most used open source
SQL Lock table Reconciliation lock MySQL Tutorial statement
For MySQL, there are three types of lock levels: page level, table level, row level
The typical page-level representative engine is BDB.The typical representative engine for the table
MySQL Tutorial quick Database Tutorial Backup and automatic backup Bat processing method, the following is the bat batch method, followed by the common SQL data various backup commands.
@echo offEcho.echo MySQL Database backup
Echo ****************
MySQL Tutorial SQL Length,right,char_length character processing function
LENGTH (str) Octet_length (str) Char_length (str) Character_length (str)Returns the length of the string str.
Mysql> Select LENGTH (' text ');-> 4Mysql> Select
The Date_add () function adds the specified time interval to the date.
GrammarDate_add (Date,interval expr type) The date argument is a valid datetime expression. The expr parameter is the time interval that you want to add.
The type parameter can
But for the first time I touched mysql, I did not understand it.Now, let's talk about the process of solving the problem:Follow the mysql installation steps:Shell> groupadd mysqlShell> useradd-g mysqlShell> gunzip | mysql-VERSION.tar.gz |
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