2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
enter:mysql -h 127.0.0.1 -P 3306 -u root -p
-h
Indicates the host where the mysql service is deployed.
-P
Indicate the port number we want to access
-u
Specify the logged in user
-p
Indicates the password that needs to be entered
If -h 127.0.0.1 is not specified, the default is to connect to the local
If -P 3306 is not specified, the default connection is to port 3306.
enter:mysql -y root
Database storage solution
mysql
Is the client of the database service
mysqld
Is the server side of the database service
MySQL is essentially a network service based on the C (mysql) S (mysqld) mode.
mysql is a network process, and the corresponding mysqld is the backend of this network service
can usenetstat -lntp
Check the port number:
MySQL is a network program that provides us with data access services.
mysqld database service
Database: generally refers to data organized in a specific structure stored on disk or in memory. It is a set of database solutions stored on disk, so the medium for database storage is disk or memory.
Why do we need a database when we can just use files to store data?
There are several disadvantages to saving data in files:
The essence of a database is a set of solutions for storing data content. Give the database fields or requirements, and the client/database file will give you the results directly.
helloworld
:create database helloworld
helloworld
:use helloworld
And create a tableLogical storage structure:
select * from student;
Determinant structure
The above work is actually completed by mysqld
The so-called installation of a database server is just installing a database management system program on the machine. This management program can manage multiple databases. Generally, developers will create a database for each application.
In order to save the data of entities in the application, multiple tables are generally created in the database to save the data of entities in the program.
MySQL is a portable database that runs on almost all current operating systems, such as Unix/Linux, Windows, Mac, and Solaris. Various systems differ in their underlying implementations, but MySQL can basically guarantee the consistency of the physical architecture on each platform.
create
, drop
, alter
insert
,delete
,update
select
grant
,revoke
,commit
The storage engine is how the database management system stores data, how to create indexes for stored data, and how to update and query data.
The core of MySQL is the plug-in storage engine, which supports multiple storage engines.
View the storage engine: `show engines;
Storage engine comparison:
`