# User add
mysql -e "CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';"
# User GET All Privileges
# ALL PRIVILEGES
# CREATE
# DROP
# DELETE
# INSERT
# SELECT
# UPDATE
# GRANT OPTION
mysql -e "GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';"
# Yetki kaldırma
mysql -e "REVOKE SELECT ON database_name.table_name FROM 'newuser'@'localhost';"
# Yetkileri görmek
mysql -e "SHOW GRANTS FOR 'newuser'@'localhost';"
# Yenileme reload
mysql -e "FLUSH PRIVILEGES;"
# User silmek
mysql -e "DROP USER 'newuser'@'localhost';"
Categories: Bash language
12,706 Comments