1. Modify User Passwordmysqladmin-uroot-p123456 Password 123 (description: 123456 is the old password, 123 is the new password) 2. Display the database (after logging into the database) show databases;3. Use database using database name 4.select
1. Download1) into the Hogne network download 5.7.23 compressed package: Https://dev.mysql.com/downloads/mysql/5.7.html#downloads2. Installation and Configuration1) Unzip the downloaded package to any directory, such as:2) Create a My.ini
11. Add DataAn existing student table is designed as follows:Sno Primary KEY and self-increment, saddress represents the address, set the default value: ' Guangdong province Guangzhou '1. Add a complete insert into tables values (Val1,val2,..., valn)
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
Scripts to monitor long transactions#!/bin/bashMysql-n-uroot-p ' password '-e ' select Now (), (Unix_timestamp (now ())-Unix_timestamp (a.trx_started)) Diff_sec,b.id,b.user, B.host,b.db,d.sql_text from Information_schema.innodb_trx a inner
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
For the installation steps, a large number of online, I will not repeat, we can degree Niang together, today only talk about the installation process of some pits:1. When authorized by the system user, a log file is generated containing the initial
Six. Aggregation functionUsing the aggregation function, you can easily analyze the data, mainly have the following application scenarios:1. Determine the number of rows in a table (statistics)2. Sum the values of a column3. Find the table column
First, the successful index optimization
1. The table data is as follows:
2. The query statement is as follows:
Explain select ID, age, level from employee where Dpid = 1 and age = of order BY
Extra:using where; Using Filesort
Execute a stored procedure using PythonExecute a stored procedure using Python [Part 2]:
1. Execute the stored procedure to get the result set of the stored procedure2. Set the return value to the @_ stored procedure name _ Number =
#!
The traditional operations in relational data operations--and (UNION), Cartesian product (Cartesian product), connection (join).1. and (UNION)" and " is to merge tables with the same number of fields and the same field type.Number of records merged =
1.WITH ROLLUP: Statistical data is performed on the basis of the Group field.Example: First group on the Name field, then some field statistics on the basis of the grouping, the table structure is as follows:CREATE TABLE' Test ' (' Id ')int( One)
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
1.1.Basic Operations Database engine
Inodb: Support transactions [atomic operations, complete a number of column operations before the completion of the operation, otherwise rollback]
MyISAM: Supports full-text indexing, emphasizing
Append from MySQL:Scenario: Add 1 from MySQL on a master-slave MySQL basisNote:This mode will lock the table at the time of backup, it is recommended to execute at night when no business is used.Create an account with Sync permissions on the main
1. Role of the index:(1) Improve query speed(2) Improve the sorting speed(3) Increase the speed of group statistics2. Parsing of the index:Explain select * from T4 where a1=3 and A2>4 and a3= 53. Clustered index and non-clustered indexNon-clustered
One, why use trigger 1. What is a trigger
Triggers are one of the MySQL database objects that need to be declared, executed, etc., the execution of the trigger is not called by the program, nor is it started manually, but is triggered and
Calculation formula:Mysql: //lng1 represents a point of latitude and longitude, Lat2 Lng2 represents B-point latitude and longitude//a = Lat1–lat2 is two points of latitude difference b = Lng1-lng2 is the difference of two points of longitude //6378
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