Table Structure OptimizationThe table uses columns of the short field, number type as much as possible.For example, IP can be converted to int by Inet_aton function, conversion rule, a.b.c.d IP number is: A * 256 of the 3 square + b * 256 of the 2
If the two table is associated with a field that is not set in the table structure, it cannot be used even if the index is set.For details, please refer to:Https://yq.aliyun.com/articles/69138?spm=5176.100239.bloglist.185.xQpeswFor MySQL explain,
To create a database server (MySQL):# Optimization by OnekeySed-i ' s#selinux=enforcing#selinux=disabled# '/etc/selinux/configgrep selinux=disabled/etc/selinux/configSetenforce 0Getenforce/etc/init.d/iptables stop/etc/init.d/iptables stopChkconfig
MySQL Database sub-Library sub-table backup script=================== students to share the sub-database sub-table ==========================The difference between a script single double quote:Single quotes are strong references, forcing output is
1, latch lock is what lock?
2, latch lock is how to protect the list?
3, the phenomenon and process of latch contention?
4. When will the latch produce serious contention?
5, how to monitor latch contention situation?
6, how to
Run command mysql-uroot-p into MySQLCreate a new database MyDatabaseEdit the settings.py file in the/mysite/mysite directory:The default database is SQLite:DATABASES = {' default ': { ' ENGINE ': ' Django.db.backends.sqlite3 ',
MySQL TransactionMySQL transaction is mainly used to deal with large-scale and high-complexity data. For example, in the Personnel Management system, you delete a person, you need to delete the basic information of the person, but also to delete the
One: Use of Mysql connectionIn the previous chapters, we have learned that it is relatively straightforward to read data in a table, but it is often necessary to read data from multiple data tables in a real application.In this section we will show
first, the basic operation of the databaseshow databases; List databasesUse database_name; Using the database_name databaseCreate Database Data_name; To create a database named Data_nameDrop database data_name; Delete a database named Data_name:Use
For data optimization, choose the most appropriate data type, not the largest.
Plastic
TINYINT: Signed Value-128-127 (250)
Unsigned value 0-255accounts for 1 bytes;2.SMALLINT: Signed Value-32768-32767 (60,005)Unsigned
Pymsql is a module that operates MySQL in Python and is used almost the same way as MySQLdbOne: Installation PymysqlPIP3 Install PymysqlTwo: Using Pytmysql#-*-coding:utf-8-*-__author__='Shisanjun'ImportPymysql#Create a connectionConn=pymysql.connect
Background: Full Library backupBackup process:1. Generate DB list, write DB name to file2. Define the backup function and write the result to the SQL file3. Compress files to reduce disk usage4. Set the number of days to retain, periodically delete
The first time to share the experience, I hope you pay more attention.The situation I encountered is this, in the navicat of a table in the varchar field content length is not enough 5 to add ' 0 ' in front of the content, such as the field content
Linux Installation Mysqllinux NetworkingIP A View network informationModify/etc/sysconfig/network-scripte/ifcfg-eth0Onboot value of the file, no change to YesTo restart the Network service:Service network restart//or compare the original
1.concatSelect as from String_test;Concat is to concatenate multiple strings together, where you can specify a delimiter (in fact, the string '-' is output to a false separation effect), as follows:Select concat (first_name,'-' as from String_test;
Original address: http://www.jianshu.com/p/33b7b6e0a396 primary keyEach row in the table should have a column (or set of columns) that uniquely identifies itself.A customer can use a customer number column, and an order can use an order ID, and an
Mysql batch Delete tables with the same prefix and modify table names, mysql batch Delete
If many tables need to be deleted and the table has the same prefix, we may need the following statement:
Drop table pre_tablename1;
Drop table
Compile and install mysql 5.6 and centosmysql in centos 7
To install a centos 7 Virtual Machine locally, first install the environment and select mysql 5.6. The installation process is as follows:1. Download mysql 5.6 package
Wget requestsTar-zxvf
Multi-to-many, database horizontal splitting architecture, multi-to-many splitting
Repost the public account's article "the path to architect"
In fact, I still don't understand some points after reading it. I will keep it for a while and then digest
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