--mysql How to record Binlog-------------------------------2014/07/08contents of the Binlog file log event MySQL's Binlog file is a record of various modifications to the database that represent the data structure of the modification operation as
These two days in the website move, this site moved using the form of direct packaging MySQL database and Web files to migrate, upload good MySQL data directory inside the database to MySQL storage database on the VPS, unzip on the line. The path to
/** Create a new user * * Log in to the root user using the command line tool or IDE. (Command: Mysql-u root-p)*/--Execute SQL statement insert user, want to use password method unified encryption, otherwise can't use. INSERT
Import java.sql.Connection;Import Java.sql.DriverManager;Import java.sql.PreparedStatement;Import Java.sql.ResultSet;public class Test {public static final String dbdriver = "Com.mysql.jdbc.Driver";Define the connection address of the MySQL
PS: This time the amount of information is a bit large.Aggregating different valuesSELECT AVG (DISTINCT prod_price) as Avg_priceFrom ProductsWHERE vend_id = 1003# The same value is not calculatedCombining aggregate functionsSELECT COUNT (*) as
Overall Backup:Back up the entire table or entire database or even all databases.Incremental backup:Back up the data in a range.1, the overall backup:To back up a table:For tables with storage engine MyISAM, you can copy the three files of frm, myd,
1: Test database table Usermysql> desc user$$+-------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra ID int(one) | NO | PRI | NULL | auto_increment | | name | varchar |
Well, people think that this kind of font is still better looking, all of us to change such a font.The INSERT INTO statement is used to insert a new row into the table.GrammarINSERT INTO 表名称 VALUES (值1, 值2,....)We can also specify the columns to
Step1:Collect information, communicate with people who talk about the system, and fully understand the tasks that the database needs to complete.Example: Blog systemBasic functions: Publish and edit articles, multi-user support, full text search,
What is an index?An object in the database.The query that is used in the database to speed up the table.The disk's I/O is reduced by locating the data by using the fast path access method.Separate from the table, but cannot exist independently, and
Table's storage Engine type:MyISAM: It is mainly used for reading and writing operations, seldom updating, deleting, and not demanding the completeness and concurrency of things.InnoDB: Apply to the integrity of the things required high, in the
is MySQL purge log simple?simple: The Purge log function is simple, purge master logs to specify a binlog, then delete the Binlog file on the previous file system and update the Binlog.index file.Complex: need to guarantee purge atomic operation,
Install and configure mysql in linuxInstall mysql 1 using yum in linux. mysql Installation check whether the old mysql version has been installed: yum list installed mysql * rpm-qa | grep mysql * install mysqlyum install mysql-servermysql-devel
Common commands for MySql management operations and Common commands for mysql operations
Log on to mysql
mysql -u username -p
Create a user name and Configure permissions. Here, you can configure all permissions for the tablename table for this user.
13. mysql partition RANGE & LIST, mysqlrange
1. range partition creation instance: create table emp (id int not null primary key auto_increment, name char (25) not null default '') partition by range (id) (define the field id as the PARTITION field
14. mysql partition HASH & KEY, mysqlhash
1. hash partition ps: I personally think the HASH PARTITION is very good and powerful, and the simple distribution is extremely even to CREATE an instance: CREATE TABLE HASH_EMP (tid int, tname char (255)
1. Getting started with mysqlI. Getting started with mysql
1 mysql-h localhost-u root-p123456 log on to the mysql server 2 show databases list all databases 3 use www select a www database 4 show tables List Data tables of the database 5 create
MySQL must know meeting book note _ 2
Wildcard: (trailing spaces may interfere with wildcard matching)
% Match any character _ match any single character
Regular Expression: REGEXP
The usage is to replace the LIKE position, followed by a regular
Main differences between MyIsam and InnoDB
MyIsam differs from InnoDB in terms of caching mechanism, transaction support, locking implementation, and physical data storage (including indexing and data ).
1. Cache Mechanism
Myisam only caches indexes
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.