Recently, I picked up MySQL again in the development project and encountered Chinese garbled characters when setting up the environment. I will share with you the solution below.
1. Show variables like 'character _ % '; shows all settings. Set
1> query data in addition to the first three data tables.
At first, I thought of this statement.
Select * from Admin where userid not in (select userid from Admin order by userid limit 3) Order by userid DESC
But it will reportThis version of
Bad SQL query statements can have a serious impact on the operation of the entire application. They not only consume more database time, but also affect other application components.
Like other disciplines, optimizing query performance is largely
MySQL is so open that you can easily adjust its default settings to achieve better performance and stability. Key variables to be optimized are as follows:
Change the index buffer length (key_buffer)
Generally, this variable controls the buffer
The prompt command displays the current user, database, time, and other information at the mysql prompt.
Copy codeThe Code is as follows: mysql-uroot-p -- prompt = "\ u @ \ h: \ d \ r: \ m: \ s>"
After the setting is successful:Copy codeThe Code is
In English, order by is the sort of rows. The default value is ascending. Order by must be followed by multiple field names.Group by is a group in English. You must have an aggregate function. At least one group flag field is required for use.
What
Test Table level;
Copy codeThe Code is as follows: create table test. level (name varchar (20 ));
Insert some data;
Code
Initialization
Copy codeThe Code is as follows: drop procedure if exists useCursor //
Create a stored procedureCopy codeThe Code
DAYOFWEEK (date)
Returns the index of the week of the date (1 = Sunday, 2 = Monday ,...... 7 = Saturday ). These index values correspond to the ODBC standard.Mysql> select DAYOFWEEK ('2017-02-03 ');-> 3
WEEKDAY (date) Returns the week index of date (
The database engine you can use depends on how mysql is compiled during installation. To add a new engine, you must recompile MYSQL. By default,
MYSQL supports three engines: ISAM, MYISAM, and HEAP..
The other two types of INNODB and BERKLEY (BDB)
1. Start and exit1. Enter MySQL:Start MySQL Command Line Client (MySQL DOS Interface) and enter the password for installation. The prompt is: mysql>Or open the terminal and enter the SQL statement:Mysql-uroot-p123
2. Exit MySQL:Quit or exit
Ii.
1. Each client connection is divided into a thread belonging to the server process. The corresponding queries of the connection are all processed by this thread.
2. The Server caches the thread. Therefore, no threads are created or destroyed for
This article briefly describes the full-text index application example, MYSQL demo version 5.5.24.
Q: When is full-text index applicable?
A: Full-text indexing is currently A key technology for big data search.
For more details, refer to Baidu.
-----
Solution 1:
Encoding during mysql installation,
Check whether my. ini exists.
Copy codeThe Code is as follows: [mysql]
Default-character-set = utf8
[Client]Default-character-set = utf8
[Mysqld]Default-character-set = utf8:
Drop table if exists
When creating a table, we will inevitably consider the problem of weeks. Therefore, the table will be modified later.
The alter table statement is required to modify a table.
Modify Table Name
Copy codeThe Code is as follows: mysql> alter table
Reference Table: student
Multi-field Query
Copy codeThe Code is as follows: mysql> select id, name, birth from student;
Query all fieldsCopy codeThe Code is as follows: mysql> select * from student;
Where specified QueryCopy codeThe Code is as
What is a view?
A view is a table imported from one or more tables. It is a virtual table.
A view is like a window in which you can view the data provided by the system.
In this way, you don't need to see the data in the entire database, but care
View version information
#1 Enter mysql in command line mode and you will see the initial prompt
Your MySQL connection id is 3
Server version: 5.1.69 Source distribution
#2 You can see the status in the command line. Copy codeThe Code is as
Create a trigger
Create a trigger with only one execution statement
Copy codeThe Code is as follows: create trigger name BEFORE | after trigger event
ON Table name for each row execution statement
The trigger name parameter indicates the name of the
A subquery is a nested query statement in another query statement.
Query results of the inner query statement, which can provide query conditions for the outer query statement
In certain circumstances, the conditions of one query statement must be
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.