Home >Database >Mysql Tutorial >How to add mysql read-write lock?
How to add a mysql read-write lock: First log in to mysql and execute the command [show databases]; then execute show to see how many database tables there are, and add read locks to the ceshi table; finally add the Just write the lock.
How to add a read-write lock to mysql:
1. First, I log in to mysql through the command line and execute the command show databases
; Check how many databases there are
2. Execute show to check how many database tables there are, select * from ceshi
Query the data in the table
3. Execute lock table ceshi read
; Add a read lock to the ceshi table.
#4. Table ceshi is also readable in another process, and writing will be delayed. After adding a read lock to the table, the read permission is available, but the write permission may be disabled or delayed.
5. Add a table write lock to the tablelock table ceshi write
;
Related learning recommendations:
The above is the detailed content of How to add mysql read-write lock?. For more information, please follow other related articles on the PHP Chinese website!