Common commandsPrinciple: Use the tool as much as possible with the visualizer, and the command line is limited to troubleshooting.mysql -u ACCOUNT -pPWD -h IP -P port [-D database] //连接数据库show databases; //显示数据库列表use db_name; //使用数据库show tables;
Create VIEW will have definer= admin @ localhost can be modified by navicat, design view-->adanced ModifyCreate function will have definer= admin @ localhost can be modified by Navicat, double-click function-->adanced ModifyStored procedure will
1. install mysql firstSpecific tutorials can refer to 52446608Note When installing the product, remember to choose MySQL Connector C,2. After installing mysql , start the configuration, click Project , Click Project Properties,3. Select the address
SET stemp= ' $ ';SET stempchd = CAST (Id as CHAR); --Conversion data formatWhile Stempchd was not NULL do--start loopSET stemp= CONCAT (stemp, ', ', stempchd); --string concatenationSELECT Group_concat (ID) into Stempchd from ' user ' WHERE
A, b two tables, find the ID field, there is a table, but there is no data in table B. A total of 13w data, after the deduplication of about 3W data, b table has 2W data, and B table ID field is indexed.Method OneEasy to understand with not in, low
Select * from ( select c.ordernumber, c.name as equipmentname, A. *, d.starttime, d.endtime, (select DateDiff (D.starttime, D.endtime)) as lev , case (select DateDiff (D.starttime, d.endtime)) When (select DateDiff (D.starttime,
Installation instructions: With the latest version of Ubuntu version 18.04 of Kylintv.Database: is MySQL Community Server 8.0.11Why not install version 5.7? Because the 5.7 version of the database, the highest supported version is UBUNTU17 so after
Read Catalogue
An introduction
Two Insert data inserts
Three Update data updates
Four delete data deletes
Five query data Select
Six Rights Management
An introductionMySQL Data manipulation: DML======================
Function:1. Intercept string from leftLeft (str, length)Description: Left (truncated field, intercept length)Example: Select Left (content,200) as abstract from my_content_t2, starting from the right to intercept the stringRight (str,
Data on the table (add and revise)View the data in the tableSelect * from user;Finding data in the user tableInserting dataInsert into User (Key,key,key,key ...) VALUES (Value,value,value,...) ;Insert a data into the user table, key represents the
SELECT * from ASELECT * from BThese are the two-sheet bodies.
SELECT * from Left JOIN on a.ID=b.a_id;statement One : SELECT*from leftjoins on a.id=and 3;Statement two: SELECT*from leftjoins on a.id=WHERE 3;The results of the
We can useSELECT * from people where Peopleid in (select Peopleid from people GROUP by Peopleid have count (Peopleid) & Gt 1) SELECT * from the users where UserID in (select UserID from the Users group by UserID has count (UserId) >
There are two main ways to use MySQL for Python operations:
Native Module Pymsql
ORM Framework Sqlachemy
Use action1. Execute SQLImportPymysql#Create a connection, connect to the databaseconn = Pymysql.connect (host ='localhost',
1.shell Script Execution If you use the current directory to execute, what do you think the command line is./xxx.sh2.A left join B, which table data is primaryA3. What are grouped functions, syntax, and filtered SQL? What's the point of note?GROUP
1. Unified character encodingEmphasis: Comments in the configuration file can have Chinese, but the configuration item cannot appear in Chinesemysql> \s # view character encoding# 1. Under MySQL's decompression directory, create a new My.ini, and
MySQL Setup password
MySQL does not have a password by default, so it is necessary to set a passwordMysqladmin-uroot password ' 123456 'mysql-uroot-p123456
Change root password/usr/local/mysql/bin/mysql -uroot更改环境变量PATH,增加mysql绝对路径密码重置vi /etc/
1. Duplicate table structure:CREATE table newName like oldname;//can copy all structures.Or:CREATE TABLE NewName SELECT * from Oldname where 1<>1;//the Where condition is not true, only the structure can be copied, content cannot be copied, and
In the Indodb_ storage engine, the primary key is a unique identifier. Typically, the insertion order of row Records in an application is inserted in the order in which the primary key is incremented.Mysql> CREATE TABLE t (a int auto_increment, B
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