AB replication: The master server builds a synchronization environment by modifying the MySQL configuration file, enabling the server to synchronize the primary server's database.Note: Both the master and slave servers need to shut down the firewall.
[TOC]1. Install MySQL1.1 in RedHat using Yum mode to remove the system's own MySQL 5.1rpm|grep mysql #查看已经安装的mysqlrpm -e mysql #普通删除模式rpm -e --nodeps mysql #强力删除模式1.2 Uninstall RPM package with Yum to prevent MySQL installation
Recently because the business requirements need to calculate the age according to the date of birth, on-line check a lot of methods, summarized here.On the Internet, many of the calculation methods have referred to the Gregorian calendar,
In -type sub-query leads to traps: (Sweep less rows, not temporary tables, do not sort files quickly) title: In the Ecshop Mall table, query 6th items, (note, number 6th is a large column) the most intuitive: MySQL> SelectGoods_id,cat_id,goods_name
MySQL adds a time interval for the date: Date_add ()Now ()//now function to get the current timeSelect Date_add (now (), Interval 1 day); -Plus 1 daysSelect Date_add (now (), interval 1 hour); -Plus 1 hoursSelect Date_add (now (), interval 1 minute);
Transferred from: http://blog.csdn.net/atco/article/details/24259333DescriptionWhen you turn on MySQL database master and slave, there will be a lot of files such as mysql-bin.00000* log, which will consume your hard disk space.mysql-bin.000001mysql-
I. Exporting a databaseMy MySQL installation directory is D:\Program files\mysql\mysql Server 5.5\bin\, the export file is expected to be placed in D:\sql\Execute command in MySQL installation directory: Mysqldump-hhostname-uusername-ppassword
use third-party tools to back up MySQL-----perconaFirst, pre-preparation work:1, install the dependency package: Yum-y Install PERL-DIGEST-MD5 Perl-dbd-mysqlRPM-IVH libev-4.15-1.el6.rf.x86_64.rpm2. Installation Main package: percona-xtrabackup-24-2.4
1. Check the currently installed PHP packageYum List Installed | grep php or Yum list installed php*If you want to delete, the executableYum Remove php.x86_64 php-cli.x86_642.RPM PackCentOs 6.xRPM-UVH
Because many business tables use a design pattern that violates the first paradigm for historical reasons or performance reasons, multiple attribute values are stored in the same column. In this mode, the application often needs to divide the column
1. Introduction to the Database
Database classification
DDL (data definition Language): Definition Language for database objects: libraries, tables, columns, etc. CREATE, ALTER, DROP
DML (Data manipulation Language):
The maintenance work of MySQL database system mainly includes the setting of user's rights, backup and recovery of database, this blog will explain these operations.User Authorization for the databaseThe root user account of the MySQL database has
MySQL Flip-flopFormat: 1, trigger definition:CREATE TRIGGER trigger_name trigger_time trigger_eventOn tbl_name for each ROW trigger_stmtDescription# Trigger_name: Trigger Name# Trigger_time: Trigger time, desirable value: before or after#
Recently in the company to do projects, involving the development of statistical reports related to the task, due to the relatively large amount of data, the query before writing query 500,000 data about 10 seconds to look like, later through the
This article was also published in https://github.com/zhangyachen/zhangyachen.github.io/issues/117First explain the MySQL version:select version();+-----------+| version() |+-----------+5.7.17 |+-----------+1rowinset (0.00 sec)Table
Today, let's look at a more difficult question, how to store the tree structure in the database?Relational databases like MySQL are better suited for storing flat data like tables, but it's hard to navigate people with depth like a tree
"Barrier Reproduction"Condition Description 01: A program is often reported in the Linux downgrade can not find the table, but I clearly built a table, testing, encountered some problems, from the Windows platform to access the virtual machine in
MariaDB multi-instance and MariaDB instance1. Install MariaDB in yum and start
yum install MariaDB-serversystemctl start mariadb.service
2. Create a directory by case and set the owner Group
Store configuration files and databases by case
mkdir -pv
Ten practical and simple MySQL functions and ten mysql Functions
Function
0. display the current time
Command: select now ().
Purpose: display the current time.
Use Cases: default values such as creation time and modification time.
Example:
mysql>
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