I. Creating a Database# # #语法:# # #create database or CREATE schema# # #create Database or schema if not EXISTS DB name###[Specifies the default value]character set sets the character set GBK Simplified Chinese UTF8 Universal Code BIG5 Traditional
I. Using SQL hintsSQL hint (SQL hint) is an important means to optimize the database, is to add some artificial hints in the SQL statement to achieve the purpose of optimization operations.1.1 Use IndexAfter the table name in the query statement,
one , install Pymysql Python is a programming language,MySQL is a database, they are two different technologies, to enable Python to operate the MySQL database requires the use of drivers. The Pymysql drive is selected here . How to install or use
Requirement: After using BULK INSERT, the ID of each record after insert is requiredNote: The Mybatis3.3.1 version later supports BULK INSERT after returning the primary key IDExample:Domin.java: Public classuser{Private intD; PrivateString name;
may help the beginner to be larger, with ripe big God gate estimate step is to remember.The specific installation steps are listed below:Steps1, the CD to a path to execute the following command:wget
The eighth chapter studies like operator, hundred percent (%) wildcard character, underscore (_) wildcardP47Select Prod_id,prod_name from products where prod_name like ' jet% '; #表示检索prod_name列中的值 all words that start with Jet,% indicates that the
One: Lamp architectureII: MYSQL/MARIADB IntroductionThree: MySQL InstallationSeveral popular versions of MySQL download5.1_64 bits binary Package: http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73-linux-x86_64-glibc23.tar.gz5.1_32 bits binary
Review:Linux environment MySQL creates new users and databases and authorizesFirst, the new userLog in to MySQL@>--p@> PasswordCreate userMysql> Insert intoMysql.User(Host,User, Password)Values('localhost','Xdev', Password ('xdev123'));//Refresh
Additions and deletions (curd) Curd Explanation: representative creation (create), Updates (update), read (Retrieve), and delete queries basic use
Querying all Columns
SELECT * from table name;Example:SELECT * from Classes;
1. InnoDB consistency Read and lock differences at different isolation levelsUnder different isolation levels, the consistent read policy and the required locks for INNODB processing SQL are different, and the characteristics of the data recovery
Index from table_nameCREATE INDEX: CREATE INDEX on table_name (COLUMN_NAME) creates a unique index: creationUnique index on table_name (COLUMN_NAME) Creating a federated Index:Createindex on table_name (COLUMN1_NAME,COLUMN2_NAME)Delete index:drop
1.1mysql Bin-log LogMySQL's bin-log log is a database statement that records data additions and deletions. As a result, bin-log can be used as a database recovery file, which is also the basis for MySQL's master-slave replication.1.1.1 Turn on MySQL'
MySQL User management New userMysql-u root-p//login MySQL
use MySQL;//Enter database MySQLCommand format create user ' username ' @ ' localhost ' identified by ' password '
Use redaction as user password
Select password (123123
MySQL time plus and minus functions are Date_add (), Date_sub ()Definition and usageThe Date_add () function adds a specified time interval to a date.The Date_sub () function reduces the specified time interval to a date.GrammarDate_add
First, insert data recordTipDesc table_name 查看表信息及字段类型避免插入类型不一致。1. Insert full data recordBasic syntaxINSERT INTO table_name( field1, field2, field3, ......fieldn) VALUES( value1, value2, value3, ......valuen) OrINSERT INTO table_name
One, MySQL installationTo install the MySQL database:Yum install-y MySQL Mysql-serverTo determine if MySQL started successfully:Service mysqld StartSecond, MySQL configuration1. Log in to MySQL:Mysql-uroot-p2. Change the host field in Mysql.user to%:
The first step, download MySQL1, Address: https://dev.mysql.com/downloads/mysql/2. Version: Mysql-8.0.11-winx64.zipSecond step, decompression Modify/Create configuration file1. If you want MySQL to be installed in the specified directory, then move
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