Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


database:mysql:manage_users

Manage MySql users

Create user
CREATE USER 'newuser'@'%' IDENTIFIED BY 'password';
Grant privileges
-- Grant all privileges including the grant option (basically an additional root user)
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'%' WITH GRANT OPTION;
 
-- Grant all privileges
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'%';
 
-- Grant read-only privileges
GRANT SELECT ON *.* TO 'newuser'@'%';
Flush privileges
FLUSH PRIVILEGES;
Change password
SET PASSWORD FOR 'user'@'localhost' = 'NewPassword';

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

database/mysql/manage_users.txt · Last modified: 2018/07/24 16:25 by tplecko