当前位置:网站首页>MySQL notes 1_ database
MySQL notes 1_ database
2022-04-23 07:11:00 【Xiaoye is stupid!】
Dos Sign in
mysql -h Server address -u user name -p password
mysql -hlocalhost -uroot -proot
database
1、 Query all databases
show databases
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
2、 Create database ("[]" Represents dispensability )
create database < Database name > [character set Encoding set ]
mysql> create database personal_inf;
Query OK, 1 row affected (0.00 sec)
3、 Delete database
drop database [if exists] < Database name >
if exists: Used to prevent errors when the current database does not exist
4、 View the encoding of the current database
show create database < Database name >
mysql> show create database personal_info;
+---------------+--------------------------------------------------------------------------+
| Database | Create Database |
+---------------+--------------------------------------------------------------------------+
| personal_info | CREATE DATABASE `personal_info` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+---------------+--------------------------------------------------------------------------+
1 row in set (0.00 sec)
5、 Modify the coding format of a single database
alter database Database name character set utf8
6、 Modify data name
Method 1:CSDN, Data migration
Method 2: Introduction mysql, then , To this data storage location , Find the file name and modify
Method 3:rename database Old name to New name
( Higher versions and above don't work , There is a risk of data loss , unsafe )
7、 Using a database
use < Database name >
mysql> use personal_info
Database changed
8、 View currently used databases
select database();
mysql> select database ();
+---------------+
| database () |
+---------------+
| personal_info |
+---------------+
1 row in set (0.00 sec)
版权声明
本文为[Xiaoye is stupid!]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230606586591.html
边栏推荐
猜你喜欢
随机推荐
ACFS文件系统创建扩大缩小等配置步骤
Tiny4412 HDMI显示
org.xml.sax.SAXParseException; lineNumber: 141; columnNumber: 252; cvc-complex-type.2.4.a: 发现了以元素 ‘b
利用队列实现栈
Abnormal record-12
Exception record-14
Oracle锁表查询和解锁方法
Build an OSS based image sharing website - polite feedback
杂七杂八的学习
[多屏互动] 实现双多屏异显二:startActivity方式
ProcessBuilder工具类
Apache SeaTunnel 2.1.0部署及踩坑
oracle表空间表分区详解及oracle表分区查询使用方法
Itop4412 kernel restarts repeatedly
接口幂等性问题
Ffmpeg common commands
Apache Atlas 编译及安装记录
MySQL笔记3_约束_主键约束
oracle库恢复数据
iTOP4412 FramebufferNativeWindow(4.0.3_r1)









