Mysql5.7 how to change the user's initial password
Modify the user's initialization password:
Set password = PASSWORD ('your new password ');
Alter user 'root' @ 'localhost' password expire never;
Flush privileges;
Create a new user: mysql5.7 how to change the user's initial password
Create user 'username' @ 'host' identified by 'Password ';
Grant permissions to users:
GRANT all privileges ON databasename. tablename TO 'username' @ 'host ';
Flush privileges;
Set and change the password:
Set password for 'username' @ 'host' = PASSWORD ('Password ');
Revoke permissions:
REVOKE privilege ON databasename. tablename FROM 'username' @ 'host ';
Delete A User:
Drop user 'username' @ 'host ';
View user authorization:
SHOW grants for 'username' @ 'host ';
The Innodb Engine supports ACID transactions:
A (Atomicity; Atomicity) indicates that A transaction is either fully executed or not executed;
C (Consistency; Consistency) indicates that the transaction operation does not change the data Consistency in the database;
I (independence; Isolation) is also called Isolation, which refers to the state in which two or more transactions are not executed alternately;
D (persistence; Durability) means that changes made after a transaction is successfully executed will be permanently stored in the database and will not be rolled back for no reason;
MYSQL isolation level:
Dirty read: allows you to read uncommitted dirty data.
Repeatable reading: some records are read at T1. when you reread these records at T2. these records may have been changed or disappeared.
Phantom read: solves the problem of non-repeated read, and ensures that the query results in the same transaction are in the state at the beginning of the transaction.
MYSQL locking mechanism:
The locking mechanism is a rule set by the database to keep various shared resources in order to ensure Database Consistency.
Row-Level Lock
The granularity of the locked object is small, which may lead to deadlocks, but the probability of resource contention locking is also minimal.
Page-Level Lock
Between row-level locking and table-level locking.
Table-Level Lock
Maximum granularity locking mechanism. It is not prone to deadlocks, but there is a high probability of resource competition.
Table-level locking is mainly applied to non-transactional storage engines such as MyISAM, Memory, and CSV. Row-level locking is mainly applied to Innodb and NDBCluster storage engines. Page-level locking is mainly used for BerkeleyDB.