First look at the SQL statement for the query:Select ID, t1,t2 from t_table where ID in (232922924);The above query statements cause the database to run high threads, resulting in a slow page response. So where do you need to optimize query
Requirements Description :With the Json_merge function in MySQL, you can combine multiple JSON objects into one objectOperation Process :1. View a table with JSON columnsMysql> SELECT * from tab_json;+----+--------------------------------------------
1. Enter user home directory to create Tools folder1 # CD #mkdir Tools2. Download MySQL5.6 binary Package1 wget http://cdn.mysql.com//archives/mysql-5.6/mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz3. Adding MySQL users and user groups1 # groupadd MYSQL2
Because I am lazy, I want to write a small code of bulk INSERT data here is the code#_*_ encoding:utf-8 _*_ImportOSImportMySQLdbImportNumPy as Npdbname='SPJ'DB= MySQLdb.connect (host="localhost", port=3306, user="Root", passwd="1234",
Test environment centos7.3+mysql5.7A table using the InnoDB engine, the table name Innodb_testThe other table uses the MyISAM engine, and the table name Innodb_testIn the event of a transactional operation, see what happens.Table structure same as
(1) InnoDB engine, InnoDB engine provides support for database acid transactions. It also provides row-level and foreign-key constraints. Its design goal is to deal with large data capacity of the database system.(2) Myiasm engine (the original
This lesson first experiences the basic syntax of MySQL. Action folder (library) increaseCreate Database db1 charset UTF8;Check# View the currently created database Show Create database db1; # View all databases show databases;ChangeALTER DATABASE
With SQL statements, delete duplicates only keep oneIn thousands of records, there are some same records, how can you use SQL statements, delete duplicates1, look for redundant records in the table, duplicate records are based on a single field
Multi-table query, SQL JOINS1. INNER JOIN inside joinsSelect S.name as student_name,t.name as Teacher_name from students as s inner joins teachers as T on S.teacherid=t.tid; /*2 table take intersection, inner connection */2. Cross-ConnectSELECT *
The first step : Use Notepad to open the "My.ini" file in the MySQL installation directory.# MySQL Client library initialization. [Client]port=3306[MySQL]default-character-set=utf8See if Default-character-set UTF8 is not UTF8 can be changed! (The
MySQL5.7 added table mysql.gtid_executedmysql5.6 master and slave, get gtid_executed from libraryAt the time of MySQL5.6, master-slave replication opens Gtid, and when slave executes show slave status \g, it can get the collection information of the
File Preparation:Django ProjectMYSLQ InstallationShutting down the firewallDrag and drop to CentOS with Xshell.installation files: Installing python3.6 (3.7 problematic)SH install_py36.sh Shutting down the firewallSH stop_firewall.shInstall MySQLSH
1. Configure the Yum sourceDownload MySQL Source installation packageshell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm# install MySQL sourceshell> Yum Localinstall mysql57-community-release-el7-8.noarch.rpmCheck that
Recently took over the maintenance of a MySQL server, the system is Ubuntu 16.04,mysql version 5.7, the installation method is apt check mysql configuration parameters found Open_files_limit is 1024, a little small, need to turn up a littleFirst
MyISAM Storage EngineAdvantages:
Supports up to 256TB of storage space
Read data faster and consume less resources
MyISAM Engine Storage File:
TBL_NAME.FRM: Table-style definition
Tbl_name. MYD: Data files
Tbl_name.
1 General IndexALTER TABLE ADD INDEX index_name ('column')2 PRIMARY Key indexALTER TABLE ADD PRIMARY KEY ('column3 Unique IndexesALTER TABLE ADD UNIQUE ('columnA unique index here guarantees uniqueness of the data record, and in many cases, creating
INSERT into ' material ' (' id ', ' file_url ')SELECT id,ekm. ' File_url 'From ' extmaterial ' as EKMLeft JOIN (SELECT ' file_url ' from ' material ' WHERE ' id ' = ID) as PM on PM. ' File_url ' = EKM. ' File_url 'WHERE EKM. ' ext_id ' = Extid and
Core points: Database tables without redundancy are not necessarily good database design, sometimes in order to improve operational efficiency, it is necessary to reduce the paradigm standardReference Blog Link: https://www.cnblogs.com/langdashu/p/59
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