Understanding mysql -- (mysql Learning 1) bitsCN.com
Understanding mysql -- (mysql Learning 1)
Mysql product: cpl protocol and commercial version
Cpl protocol: standalone and cluster version
Business: Classic, Standard, Enterprise, cluster
II. storage engine:
1. mysql server: mysqld program (similar to oracle instance)
Storage Engine: The storage engine is selected for table creation. If this parameter is not selected, the myIsam engine is used by default.
2. servers and hosts: Clients and servers
Parse --> optimize --> execute [mysql database management level | (mysqld)]
MyIsam/innodb/mysql cluster/falcon/other... [storage engine implementation]
File system
Hardware
Three types of programs: server programs, client programs, and non-client programs
Client programs are accessed through the server (mysqld), and mysqld accesses data through the storage engine. Non-client programs can directly access the storage engine without using mysqld.
Start the server: mysqld -- console
Shut down the server: mysqladmin-uroot-poracle shutdown;
3. the database is a set of tables logically and physically a collection of files.
To create a database, you create a folder and generate a. opt file to store database attributes such as character set and verification. to create a table, different files are generated based on different storage engines:
Select @ datadir; configure the database data storage directory
Select @ basedir; configure the database root directory
A. frm file will be created to store the table structure.
MyIsam engine:. myd (data file) and. myi (index file) are generated)
Innodb engine: will generate. idb or. ibdata file. check whether the configuration is to use a shared tablespace to store data and indexes or an exclusive tablespace to store data and indexes. if the exclusive tablespace is stored, each table will generate one. ibd file.
Select @ innodb_data_file_path; configure the name of each file. you can also configure this parameter without configuring... _ home_dir.
Select @ innodb_data_home_dir; configure the ibdataba data storage directory
4. mysql is a single-process multi-thread
5. the storage engine can be set at the server and table level.
Show engines; -- check what storage engine your mysql currently provides:
Show variables like '% storage_engine %'; -- check the default storage engine of your mysql instance:
Show create table name; -- it depends on the engine used by a table (the storage engine used for the table is displayed after the parameter engine in the display result ):
BitsCN.com