- Check Database:
- show databases;
- Check User
- select User FROM mysql.user;
- Check Grant
- SHOW GRANTS FOR 'myuser';
- Check Grant with details
- HOW GRANTS FOR 'myuser'@'localhost';
- SHOW GRANTS FOR 'myuser'@'127.0.0.1';
- Bind Address
- MySQL:
- /etc/mysql/mysql.conf.d/mysql.cnf
- Mariadb
- /etc/mysql/mariadb.conf.d/50-server.cnf
- Grand all privileges to a user account over a specific database:
- GRANT ALL PRIVILEGES ON mydatabase.* TO 'my_user'@'localhost';
- Grand all privileges to a user account over all databases:
- GRANT ALL PRIVILEGES ON *.* TO 'my_user'@'localhost';
- Grand all privileges to a user account over a specific table from a database:
- GRANT ALL PRIVILEGES ON my_name.table_name TO 'my_user'@'localhost';
- Grant multiple privileges to a user account over a specific database:
- GRANT SELECT, INSERT, DELETE ON mydb_name.* TO my_user@'localhost';
Create User and their permissons:
- CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'redhat';
- GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'localhost';

Comments
Post a Comment