Chapter One, DBA5 minute ExpressThe knowledge points in this chapter are as follows:
Look for a statement that runs slow sql:
Show full processlist view all executing processes and the execution of the statement time-consuming;
Could not start the service MySQL. Error 0 installation does not start when you reload the MySQL database after uninstalling, be sure to remove the MySQL related services, folders, registry removal before completely reloading the steps:1. Turn on
Suddenly received Zabbix alarm, said MySQL server/directory disk space is insufficient.Log on to the server, looked at the root of the discovery 100GB, incredibly used almost 90GB. This server only ran a MySQL, should not log not clean up and other
1. Kill all Slow query processes:#!/bin/Bashmysql-uroot-pmy_password-e"Show Processlist"|grep-I."Query">Slow_query.log forQueryinch`CatSlow_query.log |awk '{print $}'` Do Echo "kill $query;">Kill_slow_query.sql DoneLog in to MySQL, execute:Mysql>
Specifies the innodb_file_per_table=1 parameter, which is primarily to prevent the Ibdata file from being too large and all databases are stored in the file. The above problem does not occur after you specify this parameter.
Specify the default
Introduced:
Php-mysql is the most primitive Extension of PHP operation MySQL Database
The php-mysqli I represents improvement, which raises the relative advanced function, and in Extension, it also increases security.
PDO is
Introduction to the index:1, the only task for normal index normal index (indexed by keyword key or index) is to speed up access to data. Therefore, it should be only for those that most often appear in the query condition (wherecolumn=) or the data
MySQL installation here will not say, you can refer to my installation notesHttp://www.cnblogs.com/vick51/p/7048417.htmlStart configuring MySQL master and slave directly belowMySQL Master and slave Environment introductionMySQL Master system: centos6
1. Close the MySQL service, see many of the online said to use this command/etc/init.d/mysqld restart, but I did not find mysqld file in the Init.d folder, so in the execution of this command has been an error, and then replaced by sudo Service
MySQL Database backup
Use the mysqldump command to back up:Command line:
>--Use the root user to back up the person table under the test database;
Copy the entire database directory directly:Copy the database files from MySQL
A little time today, I summarize the MySQL backup several ways to check!Data in production environment is undoubtedly the lifeblood of a company, as an operations engineer can not guarantee the security of enterprise data, then is a unqualified
Mysqldump Common parameter Description:Help using: Mysqldump--help-A,--all-databases export all Databases Mysqldump-uroot-p–a >/tmp/filename.sql-y,--all-tablespaces Export all table spaces-Y,--no-tablespace s does not export any tablespace
1. Delete MySQL1 sudo apt-get autoremove--purge mysql-server-5.02 sudo apt-get remove mysql-server3 sudo apt-get autoremove mysql-server4 sudo apt-get remove Mysql-common (very important)In fact, some of the above is redundant, it is recommended to
1. Log in to the MySQL server[Email protected] ~]# mysql-u root-pEnter Password://Follow the prompts to enter the correct password2. Execute the MySQL action statementExecute "show master Logs" after logging into "mysql>" environment with Root;
1. Query log, slow query log, binary log comparison
Query log
general_log
All actions of the user are recorded, including additions, deletions, etc.
You can specify the output as a table
Slow query log
One, what is GTID (Global transaction identifiers): MySQL-5.6.2 start support, MySQL-5.6.10 perfect, GTID into two parts, part of the service UUID, The UUID is stored in the MySQL data directory in the auto.cnf file, This is a very important file,
Mysql replace into instance details, mysqlreplace
Mysql replace into instance details
Replace into is similar to insert. The difference is that replace into first tries to insert data into the table.
1. If this row of data is found in the table
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