First, the ViewA view is a virtual table (not a real one), which is the essence of getting dynamic datasets and naming them based on SQL statements. Users can only use "name" to get a result set and use it as a table.Select * from (Selectfromwhere
Simple stored Procedure INSERT statementBEGIN INSERT into VALUES (ten,3,'2013-01-02',9); #RoauDtine Body goes here ... Select -- indicates the number of rows affected ENDSimple stored Procedure ifelse statement (UserID In,username is out)BEGIN
Business scenario: Queries that correlate tables in different databasesFor example, the table to be associated with is: Table B in database A on machine a && b in database B on machine A.In this case, you want to perform "select A.id,b.id from A
Tag: Color get ADE Pre NEC class new text orderPHPSet_time_limit(0);Header("content-type:text/html; Charset=utf-8 ");$newcon=mysql_connect(' Host ', ' User ', ' pwd ');$html= ' Column name ';Echo $html;Static $i= 600000;Static $j= 0;if($newcon) {
In MySQL, there are usually these kinds of constraints:DROP DATABASE mysql_shiyan;删除数据库The primary key (PRIMARY key) is used to constrain a row in the table, and as a unique identifier for the row, the primary key is the key to the exact row in one
MySQL Optimization method:
Use index:There is no difference between indexed and indexed advantages:When a table has a large number of records, to query the table, if the index is not used, the search information method is a full table search, is
First stop the MySQL service.Two. Change the database storage master path in MySQL configuration file My.iniOpen the My.ini file in the folder C:\ProgramData\MySQL\MySQL Server 5.7,Locate datadir= "C:/programdata/mysql/mysql Server 5.7/data", which
in the When you delete a table or a piece of data in MySQL, it appears[ERR] 1451-cannot Delete or update a parent ROW:A FOREIGN KEY constraint fails (...) This is because the foreign Key association is set in MySQL, resulting in the inability to
1. Integers:Tinyint:1 bytes -128~127Smallint:2 bytes -32768~32767Int:4 bytesBigint:8 bytes2. Fixed-point number:Decimal decimal Position fixed3. Floating point numberFloat:4 bytesDoule:8 bytes4. Date, timeData: Represents only a single dateTime: Can
Displays the total population and area of each region. Only those areas with more than 1000000 area are shown.SELECT Region, sum (population), sum (area) from Bbcgroup by regionhaving SUM (area)>1000000Here, we cannot use where to filter more than 10
To view the server version:Cat/etc/redhat-releaseTo view the MySQL version:Mysql-u root-pUse MySQL;# # #mysql 5.7 or more.Update user SET authentication_string = PASSWORD (' newpassword ') WHERE user = ' root ';# # #mysql 5.7 A second old
mysql-Learning -10-20170605-Replication MonitoringThe timestamp record in evevnt performed by Sql_thread is T1The timestamp value in the event Io_thread gets is: T2T2>t1Units are: secondsMaster-slave delay, theoretically in 50MS
Query Users:Select User from User; Authorization permission: Grant the specified permission:Grant Insert,Select on *.* to 'user_name'@'localhost' with Grant option; (*.*For example: A.B=Table B in database a grants all permissions:Grant All
MySQL optimization:Each InnoDB table must have a primary keyLimit the number of indexes on a table and avoid establishing duplicate and redundant indexesCareful selection of the order of compound index key valuesPrioritize the smallest data types
Mysql user Common Operations
1. Create a user:Command: create user 'username' @ 'host' identified by 'Password ';Description: username-the username you will create, host-specifies the host on which the user can log on. If a local user can use
Automatic Generation of SQL for database data comparison and Automatic Generation of SQL for comparison1. Background
One iteration is coming to an end and is submitted to the user for testing. The system administrator starts some data in the test
Group Submission and parallel replication of MySQL5.7, and mysql5.7 commit in parallelMySQL and later versions introduce the mechanism of parallel replication, which is a very important feature of MySQL. MySQL and later versions support schema-based
Basic MySQL content
Create a databaseTable operations must first be written into the use Database Name;-- Create a database named inana_db and specify the database character encoding as utf8.Create database inana_db character set utf8;Drop database
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