Under Ubuntu 16.04, install MySQL details by entering the following 3 commands, respectively:sudo apt-get install mysql-serversudo apt install mysql-clientsudo apt install libmysqlclient-devAfter the installation is successful, you can test whether
Query test table by group_id group SORT_ID Top 100SELECT id AS ‘原数据ID‘,group_id AS ‘分组ID‘,sort_id AS ‘排序条件‘,num AS ‘排名‘FROM (SELECT @row_number := CASE WHEN @customer_no = group_id THEN @row_number + 1 ELSE 1 END AS num
#!/bin/Bashfile="Redeemcode.csv"#File=$1Database="D_redeem_info"Echo "check Redeemcode state begin ..." whileRead Line Doif[-Z"$line"]; Then Echo "is null"Else#rlt= ' mysql-d $database-h127.0.0.1-uroot-proot-e"SELECT * from t_redeem_code where
Need to install a MySQL on this machine (MAC), see the compact version of the smallest volume, the results into a manual installation of the pit (normal interface can be installed, but the installation directory will be/usr/local/mysql), since into
The 17th chapter: Combination QueryP114Select vend_id, prod_id,prod_price from products where Prod_price Select vend_id, prod_id,prod_price from Products where vend_id in (1001,1002);P115 combination of the above two statements.Select vend_id,
mysql- Data Manipulation Language (DML)1. Data insertion (add data)(1) There are 3 different forms① Form 1:Insert into table name (field name 1, field Name 2, ...). Values (value A1, value A2, ...), (Value B1, value B2, ...), ..... ;② Form 2:INSERT
First, installation1. Download. Tpcc-mysql of the TAR package2. Upload to Server (RZ)3, Decompression (TAR-ZXVF Tpcc-mysql-src.tar)II. Preparation of the databaseEnter the database, run the Create_table.sql,add_fkey_idx.sql two tables (these two
MySQL case sensitive issues under CENTOS7 cause the program to run without finding the corresponding table.Workaround:The first step: Edit the/etc/my.cnf file, add the Lower_case_table_names=1 parameter under the [Mysqld] section, and set the
Why should I set up a MySQL cluster?To alleviate the IO pressure on the MySQL server, set up multiple other MySQL servers to help him share the read and write operationsTypes of 1.mysql replication clustersMaster-Slave Architecture (read-only from
1. How does MySQL implement non-interactive queries?Mysql-h 172.16.136.9-p6515-u user-ppasswd db_name-e ' select * from game_flow_balance where ActivityID = "YWyY1oi2" an D (status = "2" or status = "4"); 'Note:-E non-interactive single quotation
Here two instances are configured, the two instances share a set of MySQL installers, using different configuration files, different boot files, different data files, listening to different ports[Email protected] ~]# Tree/data/3306│├──data # 33
Starting with version 5.6, you can use the Mysqlbinlog command to back up logs from a remote machine to a local directory, making it easier and faster to implement a Binlog server.Environment Description: 192.168.56.100 is a backup server, 192.168.56
The 14th chapter: using sub-queries.A subquery is a condition that is embedded in other queries, quite other than the select query.P91Select Order_num from where prod_id= ' tnt2 '; The =tnt2 of the #检索条件为prod_id order_num#Select cust_id from the
1. Back up the MySQL database on the server
[[email protected] ] # mysqldump -h localhost -u root -proot --databases Surpass --routines > /home/SQLBackup/Surpassme_20180801.sql
2. View the SQL script after backup
[[email protected]
MySQL Common syntax:1. Using MySQL:(1) Understanding databases and tables:SHOW databases;Analysis: Returns a list of available databases.SHOW tables;Parse: Returns the table in the current selection library.(2) Select database:use databases;Analysis:
Server-side command SQL
In the database system, SQL statements are case-insensitive (uppercase is recommended)? SQL statements can be written in one or more lines, with ";" End? Keywords cannot span multiple lines or shorthand? Use spaces
For established index (surname, first name, data)5.1, the index of the query type is valid1, full value matching: can find the surname + named Allen, the date of birth is 1990-11-05 person;2. The leftmost prefix matches: You can find the person
1. First download MySQL The version I selected is 5.7.19 based on the 64-bit Windows operating system. MySQL Portal: https://dev.mysql.com/downloads/mysql/There are different operating systems installed in the installation package you need to
On the MySQL server, view the/etc/my.cnf fileSet up:log-queries-not-using-indexes=onlong_query_time=0.03log-slow-queries=/var/log/mysql/mysqld.queries-slow.log
1
2
3
Log-queries-not-using-indexes=on open an SQL statement record
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