Content outline
Features of MySQL;
hardware, system optimization;
MySQL configuration optimization;
Schema design optimization;
SQL optimization;
Other optimizations.
Features of MySQLFirst of all, it needs to be
The length of int is not defined by itself, and the system is already defined.If you define a varchar type of 1, you must never enter ABC. int (M), Integer (m) 32-bit integer (4 bytes ...) But it's not that it's okay to say, there is a zerofll
By default, MySQL does not have the Query_cache feature turned on.MariaDB [(None)]> show variables like '%query_cache% ';+------------------------------+---------+| variable_name | Value |+------------------------------+---------+| Have_query_cache |
MySQL restricts the size of packets accepted by the server according to the configuration file.Sometimes large inserts and updates are limited by the Max_allowed_packet parameter, causing the write or update to fail.View current configurationShow
EXPLAIN is the main way to see how the MySQL optimizer decides to execute a query, a feature that has limitations, that it will always tell the truth, but that it can get the best information. Learn to explain EXPLAIN, and you'll understand how the
Today, using Python to crawl data storage needs to avoid duplication of data insertion, on the Internet to find some methods:Scenario One: Using the Ignore keywordIf the uniqueness of a record is distinguished by a primary key primary or a unique
1. adding groups and usersGroupadd MySQLuseradd-g MySQL mysql-s/bin/falseMkdir/data/mysql-pChown-r Mysql:mysql/data/mysql2. download the MySQL packageCd/usr/localwget http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.21.tar.gz3. Download the
MySQL master-slave replication:Some points to note: 1, master must open Binglog, set a unique server ID 2, each slave must be set unique server ID 3, for slaves to establish a can read the Master Binlog authorization account 4, If master has data,
MySQL * mysql_init (MySQL *mysql);//initializing an instance object for a MySQL connectionvoidMysql_close (MYSQL *sock);//release a MySQL connection instanceThere are two ways to use this function:1, the parameter is passed a null value. //It is
The following error was reported in the Select for Chinese queryERROR 1267 (HY000): illegal mix of collations (latin1_swedish_ci,implicit) and (utf8_general_ci,coercible) for operation ' =Look at the encoding of the tableShow CREATE TABLE
Environment: CentOS7Software: MySQL5.6.261 Download MySQL source packagewget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.10/zabbix-2.2.10.tar.gz2 Unzip the downloaded file to the/usr/local directory and modify the
Function: From_unixtime (Unix_timestamp,format) timestamp to string date format%M month name (January ... December)%W Week name (Sunday ... Saturday)%d The date of the month with English prefixes (1st, 2nd, 3rd, etc.). )%Y year, number, 4 bit%y year,
Environmental requirementsGCC, gcc-c++, CMake, bison (possible) support1.Yum install gcc gcc-c++ cmake Bison2, modify the Yum configuration, to achieve the search local settingsRemove or rename/etc/yum.repos.d/centos-base.repoModify Vi/etc/yum.repos.
"Reprint" http://www.cnblogs.com/AndrewXu/p/4779648.html1. Open cmd, input, enterMysql-uroot-p-p3306-h127. 0.0.1 1)-U: Specifies the user name, Root is the super-privileged user.2)-P: Enter the password, enter the password when not specified, and
1. View the number of concurrent requests for the Web server (Nginx Apache) and its TCP connection status:netstat -n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}‘Or:netstat -n | awk ‘/^tcp/ {++state[$NF]} END {for(key in state) print key,
First, open the MySQL console via Wamp.Prompt for password, because it is now empty, so press ENTER directly.Then enter "Use MySQL", meaning that using MySQL database, prompt "database changed" on the line.thenEnter the SQL statement for the
Export Database (mysqldump):Export database: Mysqldump-u user name-p database name > exported file namemysqldump-uroot-pgameol32! Lottery >/home/lottery.sql (Enter the password to start exporting the database)(If you export a single table, enter the
1. Optimize your query for query cachingMost MySQL servers have query caching turned on. This is one of the most effective ways to improve sex, and this is handled by the MySQL database engine. When many of the same queries are executed multiple
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