Automatically backs up MySQL databases under CentOS and synchronizes the differences to other network hosts1, add backup.sh:vim/root/mysql_backup/backup.sh under/root/mysql_backup/, then add the following code inside:Mysqldump-uroot-p ' a123456 '
There is a need, A and B is a parent-child relationship, B and C is a parent-child relationship, C and D is also a parent-child relationship, and so on, infiniteNow you need to query to a level (including this level) below all, you need to use the
Look at the Django document, a detailed mess, this is good for the document, but the database connection you do not cross the area. Feel anything to say and nothing to say understand, the most useful one is to recommend mysqlclient. Expanding a
1. Modify the configuration fileVim/etc/my.cnfAdd in [MYSQLD] nodeSkip-grant-tables2. Restart MySQL3. Enter with a blank passwordMysql-urootPerformUpdate Mysql.user set Authentication_string=password (' 123 ') where user= ' root ' and Host = '
After grouping, count the number of record bars:SELECT Num,count (*) as counts from Test_a GROUP by num;The query results are as follows: Statistics on number of num de-weight:Select COUNT (t.counts) from (select Num,count (*) as counts from Test_a
Optimize indexes, SQL statements, analyze slow queries;
Design the database strictly according to the design paradigm of the database;
You can save disk IO by using memcache caching, and placing frequently accessed data in the Memcache cache
Index creation Occasions:①where the Back field is suitable for indexing②order by sort fields suitable for indexing③ index Overwrite that is, the field you are querying is the index that queries the data directly in the index. For example, select
MySQL installation configurationTo update the system first[[email protected] ~]# yum-y updateView the installed MySQL version[Email protected] ~]# Rpm-qa | grep MySQLDelete the previous query out of the version, pay attention to replace the version
MySQL uses LVM snapshot for backup and mysqllvm Snapshot Backup
Create an lvm disk. The lv I created here is mydatalv and mounted to/data.
[Root @ localhost ~] # Lvs lv vg Attr LSize Pool Origin Data % Meta % Move Log Cpy % Sync Convert mydatalv
Use mysqldump for mysql backup and mysqldumpmysql backup
Note: Backup files and binary log files cannot be stored on the same disk as mysql.
Node 1
1. Modify the mysql configuration file on node 1 and enable binary log storage.
Here I put the binary
The best way for mysql to automatically back up databases at regular intervals (windows Server), mysqlwindows
There are a lot of methods for automatic Mysql backup under windows on the Internet, but there are not a few that can be used, some of
Mysql migrates database instances by copying data files, and mysql copies
Mysql migrates a database by copying data files.
-- Windows Environment
Copy the source machine database A to the target machine B:
I first install MySQL on the target
Detailed explanation of MySQL definition exceptions and exception handling, and detailed explanation of mysql Exception Handling
In MySQL, specific exceptions must be handled. These exceptions can be associated with errors and general process
Detailed instructions on installing mysql 5.6 using rpm, rpmmysql
Preface
In fact, it was very convenient to install MySQL using yum. However, the default version of myql5.0 does not support utf8mb4 (utf8mb4 can be extended to up to four characters,
In the Mysql database, tree traversal is implemented through the stored procedure, and mysql Stored Procedure
For tree traversal of multiple levels of menu bar or lower-level departments in the permission system, connect by is available in oracle,
When installing mysql in CentOS, you forget to set the root password and cannot log on. centosmysql
Preface
When mysql was started one day yesterday, the following message is displayed:The server quit without updating PID fileAfter I reinstalled
[Consolidate Mysql Basics] Detailed description of mysql explain execution plan, mysqlexplain
Original article address
1) The larger the number in the id column, the more advanced the execution. If the number is as large as the number, the
[Consolidate Mysql Basics] record the mysql statement optimization process and consolidate mysql
1. [event cause]
Today, when I was working on a project, I found that the interface provided to the client was slow for more than 2 seconds. I
View, create, and modify the encoding formats of databases and data tables in mysql.
1. view the database encoding format
mysql> show variables like 'character_set_database';
Ii. view the data table encoding format
Mysql> show create table ;
3.
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