One: plug-in storage engine
cThe terminal is connected to the s server through connectors.
Framework
SHOW ENGINES; View supported engine
SHOW table status where Engine=’InnoDB ’; Display table status information
SHOW table status\G View table status information
InnoDB Storage engine
Data are stored in table space with 2 storage formats.
1 Data and indexes of all tables of InnoDB type are stored in the same table space named ibdata1, but this approach does not support the advanced capabilities of InnoDB
2 In the configuration of asking price that...
Section 1 overview of database management system
You can see the ranking of databases in www.db-engines.com/en/ website.
The database is divided into:
Relational database:
mysql——mariaDB
oracle
Non relational database
nosql
Data management system: a more efficient data management system on disk storage mechanism.
For relational databases: Store data in tables, each table may have a correlation
Its core components: libraries, tables, indexes, views, sql, storage engines, storage functions, triggers, event schedulers
Constraints:
The p...
#—————————#—-cmdCommand line to connect to MySql———
cd C:\Program Files\MySQL\MySQL Server 5.5\bin
# Start MySQL servernet start mysql
# Close the MySQL server.net stop mysql
# Enter the MySQL command line.
mysql -h localhost -u root -p
#—————————
#—-MySqlUser management —
#To change the password: first, under DOS, enter the bin directory of the MySQL installation path, then type the following command:
mysqladmin -ur...
MySQLDatabase optimization can be considered from the following aspects:
SQLStatement optimization
Database parameter configuration
Database architecture
Hardware upgrade
First, SQL statement optimization.
1、Open MySQL database slow query
Modify the MySQL configuration file my.cnf to add the following:
After the modification is completed, restart MySQL and execute the following statement to see if the modification is effective.
2、UsemysqldumpslowCommand narrowing
Most visited5individualSQLSentence
mysqldumpslow -s c -t 5 /usr/local/mysql/data/slow-query.log
The most recordset i...
0、Get installation package
1、Add the My.ini file to the bin directory. The contents are as follows
[mysql]
# Set MySQL client default character setdefault-character-set=utf8
[mysqld]
#Set 3306 portsPort= 3306
# Set up MySQL installation directoryBasedir=D:\mysql-5.7.23-win32
# Storage directory for setting up MySQL databaseDataDir=D:\mysql-5.7.23-win32\data
# Maximum number of connections allowedMax_connections=200
# The character set used by the server is defaults to the 8 bit coded Latin1 character set.Character-set-server=utf8
# Default storage engine that will be used when c...
/*The incoming parameters are latitude latitude longitude ASC ascending order from near to far DESC descending order from far to near * /
SELECT
*,
ROUND(
6378.138 * 2 * ASIN(
SQRT(
POW(
SIN(
(
40.0497810000 * PI() / 180 - lat * PI() / 180
) / 2
),
2
) + COS(40.0497810000 * PI() / 180) * COS(lat * PI() / 180) * POW(
SIN(
(
116.3...
> input Description:
nothing
output Description:
emp_no
birth_date
first_name
last_name
gender
hire_date
10008
1958-02-19
Saniya
Kalloufi
M
1994-09-15
The answer:select * from employees order by hire_date desc limit 0,1;
1
2
second questions:
Find all staff members with the third lowest ranking time of entry staff.CREATE TABLE `employees` (`emp_no` int(11) NOT NULL,`birth_date` date NOT NULL,`first_name` varchar(14) NOT NULL,`last_name` varchar(16) NOT NULL,`gender` char(1) NOT NULL,`hire_date` date NOT NULL,PRIMARY KEY (`emp_no`));
> input Description:
nothin...
DELETE tb_movie_detail_olFROM tb_movie_detail_ol, ( SELECT min(id) id, movie_id FROM tb_movie_detail_ol GROUP BY movie_id HAVING count(*) > 1 ) t2WHERE tb_movie_detail_ol.movie_id = t2.movie_idAND tb_movie_detail_ol.id > t2.id