MySQL gets four method 1 of the self-increment ID. Select Max (ID) from tablename 2.SELECT last_insert_id () function last_insert_id is not related to table, if you insert data into form A and then insert data into table B Last_insert_ The ID will
Because the winter vacation home no broadband, it is very little internet, a few days ago with a mobile phone into their own personal blog when unexpectedly back to the database can not connect the error, scare me a jump, the site must be black, but
The default MySQL engine type is MyISAM,mysql>showengines;The transaction isolation mechanism is: read-committed (/etc/my.cnf view)Default Build table if the engine type is not specified, it is automatically myisam. You want to change the table to
Redo logs are used to achieve the persistence of transactions, i.e. d in acid, consisting of two parts:One is the in-memory redo log buffer (redo log buffer) easily lostThe second is Redo log file (redo log files) persistentInnoDB is the storage
Backup on version 5.6 server/usr/local/mysql/bin/mysqldump-s/tmp/mysql3306.sock-a-P--set-gtid-purged=off > Backup_20160204.sqlServer operation in version 5.7Mkdir-p/neworiental/data/mysql/mysql3307/{data,logs,relaylog,sock,tmp}Chown-r
3 Algorithm for row locksRecord Lock: A lock on a single row recordGap Lock: A lock that locks a range but does not contain the record itselfNext-key lock:gap Lock+record Lock Locks a range and locks the record itselfRecord lock always locks the
How to upgrade the MySQL under CentOS 6.5The CentOS 6.5 comes with MySQL 5.1 installed, but 5.1 has a lot of limitations, and in practice we've already used MySQL 5.6, which causes some scripts to execute in MySQL 5.1 with an error. We can only
The concrete structure diagram is as followsTwo nodes a master one from (the library can be hung from the top of another from the library), or a dual-master, and then use the keepalived in the event of disaster tolerant high-availability
View field information for table: DESC table name;
View all information about the table: Show create table table name;
Add PRIMARY KEY constraint: ALTER TABLE name add constraint primary key (Shape: Pk_ table name) primary key table name
[root@centos-50 servers]# rpm-ivh mysql-server-5.5.33-1.linux2.6.x86_64.rpmPreparing ... ########################################### [100%]File/usr/share/mysql/charsets/readme from install of mysql-server-5.5.33-1.linux2.6.x86_64 conflicts with file
Os:cent OS 6.3db:5.5.14If there are 100 MySQL DB instances on a server, you need to add a user name, password and authorization application IP to several databases of different ports, authorization is not a problem, anyway tired is not me, wow ka ka.
In the MySQL database, when you create a composite index, you do not know which column is in front of the creation process, which column should be in the following way:Select COUNT (Distinct first_name)/count (*) as first_name_selectivity,COUNT
Mysql> CREATE TABLE tb_test (id int (1) NOT NULL auto_increment primary key,action_id Int (TEN) not Null,error_code int. 0) NOT NULL default 0,desc_key varchar (+) NOT null default ' Audit.log.default ', INDEX (action_id), constraint ' Fk_actionid '
Primary server: 192.168.10.5From server: 192.168.10.101, the master-slave server for the following actions:1.1. Consistent version1.2. Initialize the table and start MySQL in the background1.3, change the root password2. Modify Master server Master:#
There are three modes of row-level locks:There are roughly three types of InnoDB lock Record-level Lock: Record lock, Gap Lock and Next-keylocks. Record lock Locks a row of recordsGap Lock locks Records in a certain rangeNext key lock is the overlay
MySQL Explain detailed explain shows how MySQL uses indexes to process SELECT statements and join tables. Can help select better indexes and write more optimized query statements. Using the method, add explain to the SELECT statement: such as:
Examples of mysqldump and big-log backup and recovery
Mysql version
[root@zxl-nginx~]#mysql-VmysqlVer14.14Distrib5.6.28,forlinux-glibc2.5(x86_64)usingEditLinewrapper
1. mysqldump
Mysqldump is only applicable to scenarios with small datasets.
Usage:
Hibernate development practice notes -- database issues updated when the object is set attributes
I have never found this problem before. Later, it was because the data in the database in my navigation bar had changed, and when the menu was
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