When I get used to the client, I have no idea about MySQL commands. Suddenly, SQL Yog cannot be used. How can we export data? I searched the internet, but there are a lot of answers, but they won't be used! . The backup command is
For other data centers, MySQL provides a host-specific mechanism.The most important feature is that different memory engines support different memory systems.But in general, MySQL memory engines use three types of memory customization:Rows are
(I) mysqldb This is a third-party driver that provides MySQL support for python. Complies with the python dB API 2.0 standard Official Website: http://sourceforge.net/projects/mysql-python/ (Ii) MySQL connector/Python It is built on the
Simply put, replication is actually a mechanism for synchronizing data between databases. It replays binary logs generated on the master database in the slave database to synchronize data between the master and slave databases.
Replication is
It has been nearly two months since the previous project was launched, and the problem has not been summarized. Take advantage of the days of the cold cave, the season of all things withered to their own experience, in order to promote the future.
To completely copy MySQL data files, you must ensure that MySQL has no write operations. The common practice is to create a table. If there are many tables
The operation is not convenient. the most convenient way is to change the connected
To change the data storage path, you must first modify the configuration, copy the data, and then restart.
1. to ensure data accuracy, it is best to stop the MySQL service or lock MySQL table writes.
/Etc/My. CNF
[Mysqld]Datadir
MySQL runs for a long time there will be a lot of mysql-bin.xxxx files, each is quite large.
This is the binary file of MySQL. It records all MySQL database operations, such as all your SQL statements.
This file is useful when the database crashes
1. Connect to MySQL
Format: mysql-H host address-u user name-P User Password
1. Example 1: connect to MySQL on the local machine.
First, open the DOS window, enter the directory mysqlbin, then type the command mysql-uroot-P, and press enter to
· Make sure that your mysqld server is not started using the -- skip-networking option. If this option is used, you cannot use TCP/IP to connect to it.· Check and confirm that there is no firewall blocking MySQL access. Applications such as
Two methods are described below
(I) Use information_schema.processlist
Mysql> select Concat ('Kill ', ID,'; ') from information_schema.processlist where user = 'root' into outfile'/tmp/killall.txt'; mysql> source/tmp/killall.txt;
(Ii)
(I) Optimize
Optimize can recycle space, reduce fragments, and increase I/O
Currently, the following storage engines are supported: InnoDB, myasim, and archive.
If it is a replication environment, add no_write_to_binlog (or local, the meaning is
(I) Importance of binary logs
If there is data backup at a certain point in time and all binary logs from then on
You can replay the binary logs generated since the last full backup and roll back all the changes.
(Ii) Best practices for binary
It is important to carefully select a data type. Why? It can improve performance and the principle is as follows:
● Storage (memory, disk), thus saving I/O (retrieval of the same data)
● Computing, reducing the CPU load
There are three types of
Friends from the production environment may encounter:
After a period of time, the query statements that run well may suddenly become bad.
A major possible cause is that the data distribution has changed.
As a result, the MySQL optimizer's
(I) any query is annoying.
As long as the query and MySQL are annoying, the fastest way to execute the query is not to execute
Cache is king, such as redis or memcache
(Ii) Minimum query result set
Try to query based on the primary key or
Many times, we need to select the specified number of rows starting from the specified position. At this time, limit laughed.
Limit is defined as follows:
Limit X, Y
Indicates selecting y records from row X.
When the business requires paging
Amoeba for MySQL is located between the client and database server (s), with load balancing, high availability, SQL filtering, high concurrency, read/write splitting, query route (parsing SQL query statements, request to the specified target
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.