To know the size of each database, proceed as follows:1. Access to the INFORMATION_SCHEMA database (information on other databases)Use INFORMATION_SCHEMA;2, query the size of all data:Select Concat (Round (sum (data_length/1024/1024), 2), ' MB ') as
MySQL default directory in/usr/local/mysql/var, we will modify the directory to/data1. Stop MySQL#/etc/init.d/mysql Stop2. Edit the MySQL configuration file to change the path after DataDir to/data.Vi/etc/my.sql650) this.width=650; "src=" Http://s1.5
1. Download MySQL, probably because the server operating system version is low (CentOS4.3), the installation of 5.7 prompts for Lib, just I do not need to install a new version, so downloaded 5.1 linux-generic (glibc 2.5) (x86, 64-bit), Compressed
The role of replication:Secondary implementation BackupHighly AvailableRemote disaster recoveryScale out: Load sharingServer-id is important in replication.Master-Slave architecture, do not use the MySQL agent, how to let the master responsible for
Select *,if (sva=1, "male", "female") as Ssva from Taname where sva<> ""12.2. Control process functionsCase value when [compare-value] and then result [when [compare-value] then result ...] [ELSE result] END case [condition] then result [when
Build a connection, create a Connection object$db = new Mysqli ("localhost", "root", "123", "MyDB");Judging if there is an error/*if (mysqli_connect_error ()) {echo "Connection failed! ";Exit}*/Mysqli_connect_error () Die ("Connection Failed"):
Mysql-uspider_55haitao-pspider_55haitao-dspider_55haitaomethod One executes with the cmd command (under Windows, UNIX or Linux under its console)"MySQL Bin directory" \mysql–u user name –p password –d database
In a variety of memory CPU core only 1/2 cores, memory only 512m/1g VPS, memory, CPU, hard disk are not too abundant. So the main idea is to prohibit eating large memory InnoDB engine, the default use of MyISAM. It is forbidden to eat hard disk
MySQL Case cancellation sensitive settings#mysqld--set-lower_case_table_names=1;Or add a configuration entry in the MySQL server configuration file:Vi/etc/my.cnfLower_case_table_names=1The value of the variable is defined in detail as follows:
MySQL performance optimization common tools:Common Performance testing toolsShow Engine InnoDB StatusShow Full ProcesslistInformation_schema.processlistExplainCREATE TABLE Innodb_table_monitor (a int) engine=innodb;Innodb_locksInnodb_lock_waitInnodb_
The list partition and the range partition are very similar, the main difference being that the list is a collection of enumerated value lists, and range is a continuous set of interval values. The two are very similar in terms of syntax. It is also
Reprint Https://www.baidu.com/s?ie=UTF-8&wd=cnblogThe original tears Yunshan Hai blog MySQL data type1. Integral type
MySQL data type
Meaning (Signed)
tinyint (m)
1 byte range ( -128~127)
smallint (
1. In the first step, we prepare two virtual machines (centos7,linux text).2. Configure the network environment for two virtual machines in bridged mode CentOS7 IP is 192.168.100.139, 24,linux text IP is 192.168.100.239/24, and then each
First, MySQL JOIN classificationJOIN is broadly divided into three categories as follows:INNER join (inner JOIN): Gets the record that has a connection matching relationship in two tables.Left join: Gets the left table (table1) full record, that is,
First, demand:Because we are a game business, to use MySQL, a server running multiple MySQL instances is also very normal. Adding web monitoring is too time-consuming if you modify agent.conf manually on a single station. So just think about using
Cd/daPrerequisites: Yum lib (yum install *)-bash (problem with environment variable) command not found (configuration file error)1. Build MySQL user useradd MySQL2. Create Data Catalog Mkdir-p/data/mysql4. Create profile directory/etc/my.cnf (upload
Set the character encoding used by the SQL statement: set names UTF8;Determines whether the specified database exists: DROP db if EXISTS library;Start using the specified database: use library;Create database for creating databases;Create data table
Uninstall the old version of MySQL first# See if the MySQL database is already installed on the operating system grep MySQL # execution result: mysql-libs-5.1. 3. el6_5.x86_64# Normal deletion may prompt that a dependent component cannot be
First, log cuttingPrinciple:1, CP a slow log backup2, clear the principle of slow log3, write a script, every day, so OKSecond, find the slow log in the log1, do a log cutting (slow log file is small)2. Find a slow log at a timeLog Time format: #
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