当前位置:网站首页>MySQL foundation - basic database operation
MySQL foundation - basic database operation
2022-07-26 17:11:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack
1. Delete database DROP DATABASE Database name ;
mysql> drop database test;
That is, delete the database schema
2 . Create database create DATABASE Database name ;
mysql> create database test;
stay Windows and Linux The processing of database name and table name is different , stay Windows It doesn't distinguish between uppercase and lowercase , And in the Linux Chinese distinguishes between uppercase and lowercase
3 Create a dedicated user who operates the database
Rule of grammar :
Create a new user and give him / her permission to operate the database GRANT ALL PRIVILEGES ON Database name .* TO [email protected] IDENTIFIED BY password
mysql> GRANT ALL PRIVILEGES ON test * TO user$localhost IDENTIFIED BY ‘12345’;
This gives users who connect to the database locally user Be able to home All permissions for all objects in the database to operate (ALL PRIVILEGES).
Permission is a measure of what users can do to the database , Detailed use CREATE( establish )SELECT( retrieval )UPDATE( to update )DELETE( Delete ) Such as permissions .
in addition .[test.*] part , Operate on detailed tables in the database
4 Use user Users log in to the database
mysql> -u user -p
Enter password: ******
5 Specify the database to use
Use the specified database USE Database name
mysql> use home;
6 In the use of MySQL Monitor time , Forget the specified database . Able to use SELECT Command to view the database in use today
today , Display the database used SELECT DATABASE();
mysql> select database();
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/117826.html Link to the original text :https://javaforall.cn
边栏推荐
- Analysis of the advantages of eolink and JMeter interface testing
- In May, 2022, video user insight: user use time increased, and the platform achieved initial results in cost reduction and efficiency increase
- 理财产品锁定期是什么意思?理财产品在锁定期能赎回吗?
- Pack tricks
- 快速学会配置yum的本地源和网络源,并学会yum的使用
- Relationship between standardization, normalization and regularization
- Stop using xshell and try this more modern terminal connection tool
- Alibaba cloud Toolkit - project one click deployment tool
- PXE高效批量网络装机
- Anaconda download and Spyder error reporting solution
猜你喜欢

PXE高效批量网络装机

Stop using xshell and try this more modern terminal connection tool

2022 software testing skills postman+newman+jenkins continuous integration practical tutorial
![[ctfshow web] deserialization](/img/cd/b76e148adfc4d61049ab2cf429d4d7.png)
[ctfshow web] deserialization
![[flight control development basic tutorial 3] crazy shell · open source formation UAV - serial port (basic transceiver)](/img/25/160b827d74f7902ec0d6be4683b1e5.png)
[flight control development basic tutorial 3] crazy shell · open source formation UAV - serial port (basic transceiver)

Alibaba Cloud Toolkit —— 项目一键部署工具

Marxan模型保护区优化与保护空缺甄选技术、InVEST生态系统中的应用

限流对比:Sentinel vs Hystrix 到底怎么选?

Win11 auto delete file setting method

如何保证缓存和数据库一致性
随机推荐
Matlab论文插图绘制模板第40期—带偏移扇区的饼图
【开发教程7】疯壳·开源蓝牙心率防水运动手环-电容触摸
Method and voltage setting of exciting vibrating wire sensor with hand-held vibrating wire collector
[development tutorial 7] crazy shell · open source Bluetooth heart rate waterproof sports Bracelet - capacitive touch
Digital intelligence transformation, management first | jnpf strives to build a "full life cycle management" platform
浅谈云原生边缘计算框架演进
How does win11 reinstall the system?
[flight control development basic tutorial 3] crazy shell · open source formation UAV - serial port (basic transceiver)
Stop using xshell and try this more modern terminal connection tool
Wechat applet - network data request
中金证券vip账户找谁开安全啊?
37.【重载运算符的类别】
Win11如何关闭共享文件夹
Xiaomi Wuhan headquarters building starts today! Lei Jun: planned according to the scale of 10000 people
Alibaba cloud Toolkit - project one click deployment tool
PXE高效批量网络装机
京东三面:我要查询千万级数据量的表,怎么操作?
What is a distributed timed task framework?
Marxan模型保护区优化与保护空缺甄选技术、InVEST生态系统中的应用
ES:Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes