First, the Knowledge reserveDatabase server: One computer (high memory requirements)Database management system: Like MySQL, is a softwareDatabase: Oldboy_stu, equivalent to FolderTable: Student,scholl,class_list, equivalent to a specific fileEntries:
Scenario: Dual master multiple slave db cluster is used when high concurrency and uninterrupted access to the database is requiredExperimental architecture:Lab Environment: Turn off Firewalld and SELinux firewallsOperating system version: CentOS7db1
First, install the MySQL modulepython2.xPip Install MySQLdbpython3.xPip Install PymysqlSecond, the database connection interfaceBecause Python unifies the interface of the database connection, Pymysql and MySQLdb are similar in the way they are used:
1. If you want to use a function in a MySQL statement, be sure to remember that there is no space allowed between the function name and the parentheses following it. Having space-time lattices can cause syntax errors.2. If you have entered several
Yum installationDownload the installation packageCd into yum.repo.d viewClear Bypass, no root privileges .Start mysqldView portsRefresh PasswordChange PasswordSee how many databases you haveView TableVerify the new passwordRPM InstallationDelete
Storage Engine
The storage engine is a table type, and MySQL has different processing mechanisms depending on the table type
Table is equivalent to a file, a record in the table is equivalent to a row of the file, but a record in the
The on DUPLICATE key update syntax is not a standard syntax for SQL, and if specified at the end of a sentence, it updates the contents of the database according to the specified primary key or uniquely labeled indexThe specific action is to see if
One. Nginx Boot start1. Create a script in the/etc/init.d/directoryVim/etc/init.d/nginx2. Write the contents of the script (copy the following to change the installation path accordingly)#!/bin/bash# nginx Startup script forThe Nginx HTTP server# It
Each storage engine uses three types of locking mechanisms: row-level locking, table-level lock page-level locking. Table-level locking is mainly MyISAM, memory, CSV and other non-transactional storage engines, using row-level locking is mainly the
"1" MySQL configuration file common parameter description:Bind-address:mysql the IP that is bound after the instance is startedPort:mysql the port that is listening after the instance is startedSocket: Socket file path for local socket login to
MySQL variables are divided into three categories.1, global variables (built-in variables): MySQL database built-in variables (all connections play a role) A. See All global variables: show variables; Select @@ 变量 name; Set variable
A view is a virtual table that does not actually store data and stores a "functional relationship."Grammar:CREATE VIEW name as SELECT statement.Why does a view store a function relationship?When referencing a view, it looks for related fields based
MySQL master-slave synchronization principleTransfer from Blog Park-aiapple:http://www.cnblogs.com/aiapple/p/5792939.htmlmaster-Slave formMySQL master-slave replication flexibility
One Master one from
Primary master replication
One
MySQL is a relational database management system developed by the Swedish MySQL AB Company and is currently part of Oracle 's product portfolio. MySQL is one of the most popular relational database management systems, andMySQL is the best in WEB
Principle: MySQL router reads and writes according to the port, sends all requests that connect the read-write port to master, and all requests to the read-only port are polled to multiple slave for read-write separationMaster: Sql-master 192.168.200
Develop a daemon script that monitors MySQL master-slave replication anomalies (including unsynchronized and delayed) every 30 seconds#!/bin/bashfile=/root/mysql.txt #mysql > Show slave status\g; This command can view status information and save it
Basic mysql operations: Create, view, modify, and delete Databases
Related to this section:
Create databases, view databases, modify databases, and delete Databases
Start Time:Create a database: Syntax:
Create database name [database options];
InnoDB Index,
GlossaryClustered index (clustered index)
A representation of (primary key) primary key indexes. InnoDB table store is organized based on the primary key column, which can speed up query and sorting. To achieve the best performance, be
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