当前位置:网站首页>MySQL differential deletion and modification check user login and password modification
MySQL differential deletion and modification check user login and password modification
2022-07-19 02:47:00 【For whom do the stars change】
1、 Sign in MySQL database
netstat -anpt | grep mysqld ( Check the port )
mysql -u root ( Password-free login )
mysql -u root -p ( Login with password )2、 view the database
show databases; (; The end of the statement )
( The following is the display )
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.10 sec)3、 View which tables are in the currently used library
use mysql; ( Switch to MySQL database )
show tables; ( See the table )
describe user; ( View the structure of the table )
select * from Table name ( View all data )4、 Create libraries and tables
(1) Create a library
create database benet; ( establish benet database )
( The following is the display )
Query OK, 1 row affected (0.00 sec)
(2) Create table
Create a new table
CREATE TABLE Table name ( Field 1 name type , Field 2 name type ,...,);
( The following are examples )
create table student (xuehao int,xingming char(20),xingbie char(4));5、 Insert and delete and change
(1) Insert
INSERT INTO Table name ( Field 1, Field 2,…)VALUES( Field 1 Value , Field 2 Value ,…)
( give an example )
insert into student (xuehao,xingming,xingbie) values('1','zhangsan','nan');(2) Delete
Delete a database
DROP DATABASE Database name
Delete a table in a database
DROP TABLE Database name . Table name ;
Delete a piece of data of a table in a database
delete from Table name where Conditions (3) change
Modifying data
update Table name set Name =' value ' where Conditions ;
6、 Set user permissions
(1) Create database users
grant Permission list on Database name . Table name to user name @ Source address identified by ' password ';
remarks :
Permission list :select( View permissions ) insert( Insert permissions ) update( Change permissions ) all( All permissions )
Source address : 192.168.1.10 ( Represents a host )
192.168.1.% ( Represents a network segment )
localhost ( Indicating the machine )
If there is no user, the user is automatically created (2) Revoke user privileges
revoke Permission list on Database name . Table name from user name @ Address source (3) View user permissions
show grants for user name @ Address source 边栏推荐
- Swagger -- the most popular API framework in the world
- expect免交互
- Gzip的动态压缩和静态压缩详解
- In depth performance test data analysis
- HCIP第一天_HCIA复习
- rsync远程同步(增量备份)
- 解决WIN10连接共享打印机出现0x00000709的错误
- InnoDB, MySQL structure, and the difference between the three kinds of deletion
- Dynamic programming problem - Small Soldiers rush forward
- Understand HTTP cache in 30 minutes
猜你喜欢

Traversal of binary tree

Network layer protocol and IP packet format (detailed)

How to add software shortcuts to the right mouse button list

JMeter response time test component & multi interface concurrency

ctfhub--ssrf

HCIA第一次静态路由实验

Sword finger offer 48 The longest substring without repeated characters

PXE自动化安装

安装软件提示无法定位程序输入点AddDllDirectory于动态链接库Kernel32.dll上(文末有下载地址)

The solution to the bounce and offset of unity3d game characters when jumping to the ground
随机推荐
HCIA_RIP实验
[hsjframework] unity time management timemanger timer
The difference between cookies and sessions
Echo -e usage
Full link voltage measurement
正则、扩展表达式,sed文本处理器与awk工具、用脚本改IP地址
YUM仓库服务与PXE自动部署系统
BeanShell script gets the current time
Make a simple record and check the set
2022 latest software testing tools
Test points of login function
PowerStor500T报错0x01806803
The jstat command checks the GC status of the JVM
CTFHub----RCE
静态路由综合实验
Chapter 1 - multi agent system
Flask template injection
Lintcode 366:fibonacci Fibonacci sequence
Gzip的动态压缩和静态压缩详解
正则表达式