Zotero SciHub插件终极指南:5步实现学术文献自由获取
2026/6/13 4:51:04
在LInux系统下,文件就能够存储数据,为什么还需要数据库来专门存放数据呢?
输入:
mysql-h127.0.0.1-P3306-u root-p输出:
Enter password:****Welcome to the MySQL monitor.Commands end with;or\g.Your MySQL connection id is12Server version:8.4.7MySQL Community Server-GPLCopyright(c)2000,2025,Oracleand/orits affiliates.Oracle is a registered trademark of Oracle Corporationand/orits affiliates.Other names may be trademarks of their respective owners.Type'help;'or'\h'forhelp.Type'\c'to clear the current input statement.注意:
如果没有写-h 127.0.0.1默认是连接本地。
如果没有写-P 3306默认是连接3306端口号(这具体取决于你的配置文件)
mysql>create database db1 Query OK,1rowaffected(0.00sec)在对应的mysql数据目录下,我们看到确实创建了一个db1目录
mysql>show databases;+--------------------+|Database|+--------------------+|db1||helloworld||information_schema||mysql||performance_schema||sys|+--------------------+6rows inset(0.00sec)mysql>use db1;Database changedmysql>create tablestudent(namevarchar(32),ageint,gendervarchar(2));Query OK,0rowsaffected(0.01sec)在db1目录下确实创建了对应的文件
mysql>insert intostudent(name,age,gender)values('张三',21,'男');Query OK,1rowaffected(0.00sec)mysql>insert intostudent(name,age,gender)values('李四',21,'男');Query OK,1rowaffected(0.00sec)mysql>insert intostudent(name,age,gender)values('王五',88,'男');Query OK,1rowaffected(0.00sec)mysql>select*from student;+--------+------+--------+|name|age|gender|+--------+------+--------+|张三|21|男||李四|21|男||王五|88|男|+--------+------+--------+3rows inset(0.00sec)存储引擎是:数据库管理系统如何存储数据、如何为存储的数据建立索引和如何更新、查询数据等技术的实现方法。是真正直接与OS打交道的地方
MySQL的核心就是插件式存储引擎,支持多种存储引擎。
查看存储引擎
mysql>show engines;+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+|Engine|Support|Comment|Transactions|XA|Savepoints|+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+|ndbcluster|NO|Clustered,fault-tolerant tables|NULL|NULL|NULL||MEMORY|YES|Hash based,stored in memory,usefulfortemporary tables|NO|NO|NO||InnoDB|DEFAULT|Supports transactions,row-level locking,andforeign keys|YES|YES|YES||PERFORMANCE_SCHEMA|YES|Performance Schema|NO|NO|NO||MyISAM|YES|MyISAM storage engine|NO|NO|NO||FEDERATED|NO|Federated MySQL storage engine|NULL|NULL|NULL||ndbinfo|NO|MySQL Cluster system information storage engine|NULL|NULL|NULL||MRG_MYISAM|YES|Collection of identical MyISAM tables|NO|NO|NO||BLACKHOLE|YES|/dev/null storageengine(anything you write to it disappears)|NO|NO|NO||CSV|YES|CSV storage engine|NO|NO|NO||ARCHIVE|YES|Archive storage engine|NO|NO|NO|+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+11rows inset(0.00sec)