MySQL Database Search Example exercise (basic exercise):The MySQL database is built with two tables, with the following examples:CREATE TABLE Student (Stuno CHAR (8) PRIMARY KEY,Stuname VARCHAR () not NULL,Stuage TINYINT not NULL,Stusex
Connect MySQL User: mysql-u root-p Enter passwordCreate DATABASE: "Database name"Copy data: Navicat Transfer data functionProblems that occur during the process:1, open the table, reported 1018,can ' t read dir of '. xxxx ' (errno:13)
ProblemThe Bin-log backup/restore database needs to be turned on, but because the store itself Bin-log saved is too small, and the collation is not good, so you create a new/data/binlog to save the binary logAfter the/ETC/MY.CNF has increased the
0 Select Now () Displays the current time.1 Select char_length (' Andyqan ') Displays the character length.Date of 2nd format Select Date_format (now (), '%y-%m-%d ')3 Add/Decrease Date Time Select Date_add (now (), Interval 1 day)4 Type
JMeter---mysql pressure testone, add MySQL drive jar packageAdd a jar package on the test Plan pagesecond, add MySQL connection configurationAdd thread group Right-click-Add (add)-config Element (config element)-->JDBC connection ConfigurationCore
Date-time functions1. Get the current date and timeSELECT now (), Sysdate (), Current_timestamp () from DUAL2. Get the current dateSELECT curdate (), Current_date () from DUAL3. Get the current timeSELECT curtime (), Current_time () from DUAL4.
#创建用户CREATE USER ' zzq ' @ ' localhost ' identified by ' zzq ';#flush the Privileges command essentially extracts the user information/permission settings from the current users and Privilige tables from the MySQL library (the built-in library of
MySQL 5.7.8 begins to support JSON types.CREATE TABLE T (ID int,js json,primary KEY (' id '))Inserting dataINSERT into t values (1, ' {"A": 1, "s": "abc"} ')INSERT into t values (2, ' [1,2,{' a ': 123}] ')INSERT into t values (3, ' "str")INSERT into
Create a stored procedureCREATE PROCEDURE myprocess ()BeginEndTo avoid a semicolon (";") in the stored procedure In the concluding sentence, we use a delimiter to determine whether the command is over.So we can use the $ sign as a closing (or
Keepalived is responsible for failover, and the consistency of data between nodes after failover depends on the specific replication mode.Whether it is master-slave, a master multi-slave or dual-master, the number of cluster nodes, master-Slave
Date_format (Date,format) function
Placeholder
Description
%a
Abbreviated Day of the week (Sun .....) Sat)
%b
Abbreviated month (Jan .....) DEC)
%c
Month in number form (1 ..
Preface: The Knowledge of explain (executive plan) has been studied, and the index is optimized and analyzed by explain.0. PreparationFirst create three tables: tb_emp (Staff table), tb_dept (departmental table) and Tb_desc (description table)1)
1. ReasonThe failure of the company server and the abnormal shutdown caused the database to start failing.Error message[[email protected] dmp]#/etc/init.d/mysqld startStarting MySQL. error! The server quit without updating PID file (/opt/mysql/data/1
Composite Index principle:The leftmost prefix principle:Index (A,B,C)1, each query must have a, such as AB,AC,ABC, if not a, only the BC query will expire2, query with or, query invalidation3, the query with%*, invalid query.4, where a=* and B > and
MysqlData optimizationBasic steps for slow query optimization0. Run first to see if it is really slow, note the setting Sql_no_cache1.where condition single Check, lock minimum return record table. This sentence means to apply the where of the query
Directory:1. Constraints 2. ALTER TABLE3. VIEW1. ConstraintsDescription: SQL constraints are used to specify the data rules in the table, and if there is a violation of the data behavior of the constraint, the behavior will be constrained to
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