* The subquery and Join operations are optimized, including Batch index access in the scattered regions of MyISAD and InnoB storage engines.
* The backup database and RESTORE statements are added for BACKUP and restoration. For details, see section 6
SymptomMysql CPU usage: 188% (multi-core)Solution1. Slow QueryVi/etc/my. cnf Add the following content under mysqld: Log-slow-queries = slow. logLong_query_time = 5It means to record the SQL to slow. log for more than 5 seconds.Find the content of
Solution 1:
Log on to the MySQL Server using the MySQL Adminstrator GUI Tool. The Server returns the following error message: Host 60-248-32-13.HINET-IP.hinet.net is not allowed to connect to this MySQL server.
This is because of permission issues.
1. MySQL concurrency and Isolation Control Mechanism
Meta-data metadata lock: Implemented in the table cache and provides isolation for DDL (Data Definition Language. A special meta-data metadata type called Name Lock. (SQL layer)
Table-level data
Before MySQL5.1, general log cannot be enabled or disabled at run time. Sometimes it is very troublesome to capture SQL to find the problem. By chance, I found a good tool: mysqlsniffer, which can be used to capture SQL statements, the help is as
Mysql user adding method
Create Database gamesp
Create database gamesp;
Add User
Grant all on database name. * to username @ localhost identified by password;
Grant all on gamesp. * to newuser @ localhost identified by password;
Note:
(1)
MYSQL performance optimization involves many aspects. This article will describe some key MySQL parameters, which are key parameters that determine the performance of MySQL databases to a certain extent. We often encounter performance problems
WEB developers not only need to solve the program efficiency problem, but also need to quickly access and respond to databases. I hope this article will help you master the MySQL optimization skills.
1. Optimize Your MySQL query Cache
You can enable
If you are new to MySQL databases, you must know how to delete multiple tables in MySQL. The following describes how to delete multiple tables in MySQL for your reference, I hope it will help you learn how to delete multiple tables in MySQL.
1.
Mysql> grant permission 1, permission 2 ,... Permission n on database name. Table name to user name @ user address identified by 'Connection password ';Permission 1, permission 2 ,... Permission n indicates 14 permissions, including select, insert,
How do you feel if you are a racing driver and you can immediately change the engine without driving your car to the garage? What MySQL database does for developers is like changing the engine by pressing a button. It lets you select a database
After the upgrade, import the previously backed up data1. An error is reported when importing data. Cannot load from mysql. proc. The table is probably updated upted, which is caused by an upgraded version.Solution: mysql_upgrade-u root-p2.
Sometimes you forget the password of the root account in mysql, or the password is empty, resulting in no access to mysql or extremely low security. In this case, you need to update the password of the root account. There are many ways to change
Mysqldump
Back up the entire database
Mysqldump-u root-ppassword databasename> data. SQL
// Enter the root password.
Back up one or more tables
Mysqldump-u root-p databasename table1name table2name> data. SQL
// Enter the root password.
Varchar occupies 2 bytes for each English (ASCII) character, and only two bytes for one Chinese CharacterChar occupies 1 byte for English (ASCII) characters, and the type of Varchar that occupies 2 bytes for a Chinese character is not filled with
Replication is not a copy, but a replication. From today on, I will discuss the mysql replication issue in several chapters, the master-slave replication issues will be explained in detail separately. First, I would like to explain the mechanism of
I have recently installed DRBD + heartbeat + replication. I'm afraid I will forget it later. record it.1, operating system: centOs 5.6 64-bit, mysql-5.5.112. Four machines, two as DRBD, and two as replication slave servers.3. Name: MYSQLM1 IP: 172.17
Query
Today
Select * from table name where to_days (time field name) = to_days (now ());
Yesterday
SELECT * FROM table name WHERE TO_DAYS (NOW ()-TO_DAYS (time field name)
7 days
SELECT * FROM table name where DATE_SUB (CURDATE (), INTERVAL 7
Because the server space is tight, you need to move mysql datadir under Ubuntu 10.04 from the default/var/lib/mysql to/usr/local/mysql. The operation is as follows:1. Changed/etc/mysql/my. cnf to datadir =/usr/local/mysql.2.
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.