社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
一 MySQL命令
1 链接
mysql -uroot -p
2 输入密码
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 21645
Server version: 5.7.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
3 查看数据库服务器存在哪些数据库:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| jdbcdemo |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
4 其他指令
使用指定的数据库:
USE database_name;
查看指定的数据库中有哪些数据表:
SHOW TABLES;
创建指定名称的数据库:
CREATE DATABASE database_name;
删除数据库:
DROP DATABASE database_name;
二 MySQL存储引擎
MySQL的存储引擎:
MySQL中的数据用各种不同的技术存储在文件(或者内存)中。这些技术中的每一种技术都使用不同的存储机制、索引技巧、锁定水平并且最终提供不同的功能和能力。
通过选择不同的技术,你能够获得额外的速度或者功能,从而改善你的应用的整体功能。
-------------------------------------------------------------------------------------
MyISAM:拥有较高的插入,查询速度,但不支持事务,不支持外键。
InnoDB:支持事务,支持外键,支持行级锁定,性能较低。
InnoDB存储引擎提供了具有提交、回滚和崩溃恢复能力的事务安全。但对比MyISAM,处理效率差,且会占用更多的磁盘空间以保留数据和索引。
其他类型
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!