Create users and grant privileges on MySql

  • by

login to mysql
mysql -u root -p
USE 'your_schema';
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
check all users and paswords:
SELECT user,host,password FROM mysql.user;

Refs:
https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql
https://chartio.com/resources/tutorials/how-to-grant-all-privileges-on-a-database-in-mysql/
https://chartio.com/resources/tutorials/how-to-grant-all-privileges-on-a-database-in-mysql/
https://www.liquidweb.com/kb/remove-permissions-for-a-mysql-user-on-linux-via-command-line/
https://www.shellhacks.com/mysql-show-users-privileges-passwords/

Leave a Reply

Your email address will not be published. Required fields are marked *