In MySQL's MyISAM engine, there is one that is easy to overlook, called Compressed index Pack_keys,
MyISAM uses prefix compression to reduce index size by compressing strings by default, or compressing integers
You can use Pack_keys to control the
In reality, MySQL can build a composite index based on business needs, because MySQL uses the B-tree format index, you can locate records directly without scanning. MySQL establishes the principle of the leftmost prefix for multiple-column indexes,
Paris Country 10m-100m Unlimited flow free universal space
Site size: 10m-100m (gradually increase the space to 1G) support the external chain
Background operation: The simplest Control Panel
Support scripts: ASP PHP5 HTM HTML CGI
There is no
Sometimes when we manage the database we need to use the command to perform import and export operations, because this is stable and reliable, not easy to have garbled appearance. and the imported database size is unrestricted.
MySQL Database
Mysqlhotcopy usage
You need to install PERL-DBI and Dbd-mysql before using mysqlhotcopy:
1, the implementation of Yum install PERL-DBI installation perl-dbi.2, installation Dbd-mysql Please refer to the bottom material
A common example of backup:
command line source Import Database:
The code is as follows
Copy Code
1, to move the imported. sql file to the bin file, this is a convenient path2, the 1th step with the above export3, enter mysql:mysql-u user name-PAs
Installation EnvironmentCentOS 5.4MySQL 5.1.xx with rpm direct installationxtrabackup 1.2.22 with rpm direct installation1. master:/etc/my.cnf
The code is as follows
Copy Code
[Mysqld]Server-id = 1Log-binInnodb_flush_log_
Cases
The code is as follows
Copy Code
mysqldump--default-character-set latin1-uroot-pxxx database name >/tmp/old.sql
Similarly, the same is true for exports:
The code is as follows
Copy Code
First we want to enter your MySQL server, use net stop mysql to stop MySQL, and then run the DOS command, enter CMD in the run, and then switch to the MySQL bin directory, run the command:
The code is as follows
Copy Code
Method One, has the server Management permission modification method
View database-level character set support
The code is as follows
Copy Code
Mysql> show VARIABLES like character_set_% ';Mysql> show VARIABLES like
SQL statement:
The code is as follows
Copy Code
UPDATE table_name Set Field_name=replace (field_name, ' from_str ', ' to_str ')
Descriptiontable_name--the name of the tablefield_name--Field Namefrom_str--a
$ Errmsg = "";If (! @ Mysql_connect ("localhost", "trainee", "abc123 ")){$ Errmsg = "Cannot connect to database ";} @ Mysql_select_db ("wellho ");// First run ONLY-need to create table by un commenting this// Or with silent @ we can let it fail
Mysql_get_server_infoDefinition and usageThe mysql_get_server_info () function gets information about the MySQL server.This function returns MySQL server version success or FALSE failure.SyntaxMysql_get_server_info (connection)Parameter
Data verificationClear spacesThe trim function will clear spaces at the beginning and end of the data. Its syntax is:Trim ($ first_name );Processing of required fieldsSome fields must be entered in your database. In this way, the fields
Free FTP, PHP, MYSQL, no ads + Rice space bindingFree website hosting package Free1k.com includes:-1 000 m B storage space-enough or even the largest content website-000 MB bandwidth-the most abundant enterprise and personal websites. If you need
* 4000 MB disk space (4 GB storage)* 8000 MB transfer (8 GB bandwidth)* PHP/MySQL database* NO advertisement!* Free subdomains (http://username.4000webs.com )!* FTP or browser-based file manager* Fast innovation and reliable dual-core servers with a
SQL statementSELECT *FROM (SELECT 'field', count (*) AS totalFROM 'table name'Group by 'Group field') AS tWHERE total> 10 and grouping fields <> ""This means that after the joint query, the data found by the group is processed as a condition. After
Note:An online MySQL database server suddenly loses power, causing system failure to start up. After you reinstall the system, find the previous MySQL database folder.Problem:By copying files to restore the previous MySQL database, we found that the
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