当前位置:网站首页>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
边栏推荐
- Oracle RAC数据库实例启动异常问题分析IPC Send timeout
- 通过rownum来进行区间查询
- 一款png生成webp,gif, apng,同时支持webp,gif, apng转化的工具iSparta
- 基于BottomNavigationView实现底部导航栏
- Information:2021/9/29 10:01 - Build completed with 1 error and 0 warnings in 11s 30ms Error异常处理
- webView因证书问题显示一片空白
- oracle生成毫秒级时间戳
- 19C RAC修改VIP及SCANIP步骤-同网段
- Android-Room数据库快速上手
- mysql和pg库遇到冲突数据时的两种处理方式
猜你喜欢
随机推荐
adb shell top 命令详解
Abnormal record-17
oracle生成毫秒级时间戳
Android room database quick start
oracle数据库将多个列的查询结果集合并到一行中
useReducer基本用法
ACFS文件系统创建扩大缩小等配置步骤
OSS云存储管理实践(体验有礼)
Abnormal record-12
Django::Did you install mysqlclient?
oracle清除sql的缓存
10g数据库使用大内存主机时不能启动的问题
Oracle索引状态查询与索引重建
19C环境ORA-01035登陆报错处理
iTOP4412无法显示开机动画(4.0.3_r1)
Static interface method calls are not supported at language level ‘5‘ 异常解决
oracle 修改默认临时表空间
常用UI控件简写名
MySQL笔记2_数据表
Oracle和mysql批量查询用户下所有表名和表名注释








