grant all privileges on *.* to 'username'@'%' identified by 'password';
此语句可直接生成mysql用户,而不需要在mysql.user表中另外insert。
此语句也可用来为用户授权。
all privileges 可改为 select,update,delete等等。
*.* 可改为特定某个数据库,例如:test.*。
% 可改为 localhost, 或者特定ip。
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3