跳到主內容

MySQL_帳號管理

新增帳號

--新增使用者 test, 密碼 newpassword, 允許任何來源 %
CREATE USER 'test'@'%' IDENTIFIED BY 'newpassword';

--新增使用者 test, 密碼 newpassword, 只允許本機(localhost)
CREATE USER 'test'@'localhost' IDENTIFIED BY 'newpassword';

賦予權限

--所有權限
grant all privileges ON *.* TO 'test'@'%';
--更新權限
flush privileges;