// 顯示資料庫
show databases;
// 選擇 mysql db
use mysql;
// 顯示 user 權限
show grants for username;
// 開啟mysql db 連線的ip
grant all on dbname.* to ‘username’@‘localhost’ identified by ‘password’;
grant all on dbname.* to ‘username’@‘ip’ identified by ‘password’;
// 顯示目前帳戶@ip 資訊
show grants for [email protected]ip;
// 更新權限
flush privileges;
时间: 2024-10-12 02:32:27