MySQL Multi-instanceOverview: Running multiple database services on a single physical hostFunction: Save operation and maintenance cost, improve hardware utilizationConfiguration Step DescriptionWe take mysql-5.7.20 as an example--Install packages
1. View slave statusshow slave status\G2, stop slave State, clear the master-slave information from the librarystop slave;reset slave all;3. Deleted from library synchronized main library databaseDROP DATATBASE DBNAME;4. Backing up primary database
MySQL in Myisam,innodb by default is the Btree index, as to how the data structure of btree is not important,Only need to know the result, since is the index that this data structure finally is orderly, like Xinhua dictionary His directory is
A brief introduction: Today let's talk about some problems in the slow query logTwo phenomena: Slow log appear some slow SQL, slow log appear slow SQL is not strange, strange is slow log take out itself is the second level execution, not slowThree
A constraint is a restriction that ensures the integrity and uniqueness of a table's data by restricting the data on the table's Rows or columnsConstraint classification:Constraint types and keywords:
Primary KEY PRIMARY Key
Default
1.mysql and Promise-mysqlNodejs connection MySQL has a mature npm package MySQL, if required promise, recommended to use Promise-mysql;Npm:https://www.npmjs.com/package/mysqlHttps://www.npmjs.com/package/promised-mysqlIn the actual development, the
1. Configure PHP.iniVi/etc/php.ini2. Configure ApacheMake a backup of the files you need to configure firstCp/etc/httpd/conf/httpd.conf/etc/httpd/conf/httpd.conf.bakAfter editing the configuration vi/etc/httpd/conf/httpd.conf configuration is
There are two ways to fully backup MySQL:
Packaging a folder backup with tarInstalling the XZ compression Format tool: Yum–y install XZPackage The database folder: Tar jcvf/opt/mysql-$ (date +%f). tar.xz/usr/local/mysql/data/
Backing up
MySQL is not like Oracle has plsqldevelper tools to debug stored procedures, so there are several simple ways to track the execution process: 1, with a temporary table, recording debugging process; 2, directly in the stored procedure, add select XXX,
auto_increment Questions:Https://yq.aliyun.com/articles/59263?spm=5176.8091938.0.0.bjzoFNHttps://dev.mysql.com/doc/refman/5.7/en/innodb-auto-increment-handling.htmlSeveral situations that cause auto_increment to become smaller:Reference:
MySQL Database Development Learning Tutorial one, database designDatabase design (i)--Database designhttp://blog.51cto.com/9291927/2087925Second, MySQL database development Basic TutorialThe basic MySQL database development Tutorial directory is as
MySQL (default data table Myisam&inonodb)Can be set in MySQL config file My.ini, the book is written in Default-table-type. But not found in the My.ini, but# The default storage engine that would be used when create new tables
First, the operation of the table1. View all TablesShow tables;2. Create a tableCREATE TABLE table name (field 1 type 1 constraint 1, field 2 type 2 constraint 2);3, modify the name of the tableRename table name to the new name;4. Delete a
MySQL is not sensitive to trailing spaces73530589Conclusion: It is recommended to trim the string in the query condition, preferably trim when the data is in storage.Example1:The field values in the table do not have spaces, where the query
Today using the IDE connection line under MySQL error can not connect to MySQL server. Too many connections, the error is clear, the connection with MySQL is full. Also, each service creates a MySQL connection pool, which takes up a lot of long
WHERE conditional clausesSyntax format:SELECT * FROM table name where condition;For example:Mysql> SELECT * from M1;+------+------+------+---------+| ID | name | Age | Address |+------+------+------+---------+| 001 | L1 | 4 | Beijing || 002 | L2
then the last blog post MySQL mha+keepalived scenario demo (iv) in the failover of MySQL, the current main library becomes the 192.168.2.129 machine, while the 129 machine on the keepalived service is turned on. However, 192.168.2.128 's original
I. Database additions and deletions1. Create a new databaseCREATE database name CharSet UTF8;Database name rule: can be by letter, number, underscore, @, #, $ case-sensitive, cannot use keywords such as create SELECT, cannot use numbers alone,
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