mysql> show global variables like "%read_only%";
mysql> flush tables with read lock;
mysql> set global read_only=1;
mysql> show global variables like "%read_only%";
將MySQL從只讀設(shè)置為讀寫狀態(tài)的命令:
mysql> unlock tables;
mysql> set global read_only=0;
打開數(shù)據(jù)庫工具
找到工具選項(xiàng)打開命令行界面
輸入以上命令行
注意要在root賬戶下執(zhí)行