当前位置:网站首页>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
边栏推荐
- How to connect tdengine with idea database tool?
- How does win11 reinstall the system?
- [daily3] vgg16 learning
- Understanding JS foundation and browser engine
- Marxan模型保护区优化与保护空缺甄选技术、InVEST生态系统中的应用
- Alibaba side: analysis of ten classic interview questions
- Matlab论文插图绘制模板第40期—带偏移扇区的饼图
- FIR filter design
- JD Sanmian: I want to query a table with tens of millions of data. How can I operate it?
- "Green is better than blue". Why is TPC the last white lotus to earn interest with money
猜你喜欢

Win11自动删除文件设置方法

My meeting of OA project (meeting seating & submission for approval)

37.【重载运算符的类别】

Nacos win10 installation and configuration tutorial

Operating system migration practice: deploying MySQL database on openeuler

How to ensure cache and database consistency

2022-2023 信息管理毕业设计选题题目推荐

Singleton mode

Pyqt5 rapid development and practice 3.4 signal and slot correlation

Matlab paper illustration drawing template issue 40 - pie chart with offset sector
随机推荐
Speaker recruitment | AI time recruit icml/ijcai 2022 as a Chinese speaker!!!
别用Xshell了,试试这个更现代的终端连接工具
Is it safe for Guosen Securities to open an account? How can I find the account manager
Win11 auto delete file setting method
Chapter 1 Overview - Section 1 - 1.3 composition of the Internet
Win11怎么自动清理回收站?
Win11如何关闭共享文件夹
【飞控开发基础教程2】疯壳·开源编队无人机-定时器(LED 航情灯、指示灯闪烁)
[Luogu cf643f] bears and juice (conclusion)
Sharing of 40 completed projects of high-quality information management specialty [source code + Thesis] (VI)
2022-2023 topic recommendation of information management graduation project
[development tutorial 7] crazy shell · open source Bluetooth heart rate waterproof sports Bracelet - capacitive touch
Redis hotspot key and big value
浅谈云原生边缘计算框架演进
[basic course of flight control development 2] crazy shell · open source formation UAV - timer (LED flight information light and indicator light flash)
[basic course of flight control development 1] crazy shell · open source formation UAV GPIO (LED flight information light and signal light control)
2022 software testing skills postman+newman+jenkins continuous integration practical tutorial
ES:Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes
【Express接收Get、Post、路由请求参数】
Packet capturing and streaming software and network diagnosis