Differences
This shows you the differences between two versions of the page.
— | database:mysql:manage_users [2019/10/31 09:04] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Manage MySql users ====== | ||
+ | <code sql Create user> | ||
+ | CREATE USER ' | ||
+ | </ | ||
+ | <code sql Grant privileges> | ||
+ | -- Grant all privileges including the grant option (basically an additional root user) | ||
+ | GRANT ALL PRIVILEGES ON * . * TO ' | ||
+ | -- Grant all privileges | ||
+ | GRANT ALL PRIVILEGES ON * . * TO ' | ||
+ | |||
+ | -- Grant read-only privileges | ||
+ | GRANT SELECT ON *.* TO ' | ||
+ | </ | ||
+ | |||
+ | <code sql Flush privileges> | ||
+ | FLUSH PRIVILEGES; | ||
+ | </ | ||
+ | |||
+ | <code sql Change password> | ||
+ | SET PASSWORD FOR ' | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | If MySql server is accessible from network, limit users access from local lan by using 10.0.0.% instead of just %, or enter a specific IP address | ||
+ | </ | ||
+ | |||
+ | |||
+ | <code sql> |