The method of modifying user's initial password by mysql5.7
Xiaobian to share with you mysql5.7 to modify the user's initial password method, I hope you read this article after the harvest, let's discuss it together!
Change the user's initialization password:
SET PASSWORD = PASSWORD('your new password');ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;flush privileges;
Create a new user:
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
Grant permissions to users:
GRANT all privileges ON databasename.tablename TO 'username'@'host';flush privileges;
Setting and changing passwords:
SET PASSWORD FOR 'username'@'host' = PASSWORD('password');
Revoke authority:
REVOKE privilege ON databasename.tablename FROM 'username'@'host';
Delete user:
DROP USER 'username'@'host';
View user authorization:
SHOW grants for 'username'@'host';
The Innodb engine provides support for ACID transactions:
A (atomicity) means that a transaction is either fully executed or not executed;
C (Consistency) means that the transaction runs without changing the consistency of the data in the database.
I (Independence), also known as isolation, refers to the state in which two or more transactions do not alternate;
D (Durability) means that after the transaction is successfully executed, the changes made will be persisted in the database and will not be rolled back for no reason.
MYSQL isolation level:
Dirty Read: Allows reading of uncommitted dirty data.
Non-repeatable reading: Some records were read at T1, and when they were reread at T2, they might have been changed or disappeared.
Fantasy reading: solves the problem of non-repeated reading, ensuring that in the same transaction, the query results are the state at the beginning of the transaction.
MYSQL locking mechanism:
Locking mechanism is a kind of rule that database sets in order to ensure database consistency and make all kinds of shared resources become orderly when they are accessed concurrently.
row-level locking
The granularity of locked object is very small, which easily causes deadlock, but the probability of locking resource contention is also the smallest.
page-level locking
Between row-level locking and table-level locking.
table-level locking
Locking mechanism for maximum granularity. Deadlocks are not easy to occur, but the probability of resource competition is high.
Table-level locking is mainly applied to non-transactional storage engines such as MyISAM,Memory, CSV, etc. Row-level locking applies primarily to Innodb and NDBCluster storage engines. Page-level locking is primarily used for Berkeley DB.
After reading this article, I believe you have a certain understanding of mysql5.7 to modify the user's initial password method, want to know more related knowledge, welcome to pay attention to the industry information channel, thank you for reading!