Last active
April 14, 2024 06:58
-
-
Save mrtdeh/e2b974e6bcd1a888b6ed190467ec8459 to your computer and use it in GitHub Desktop.
create admin user with all privileges on mysql/mariadb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'some_pass'; | |
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; | |
## remote connection - not secure | |
CREATE USER 'admin'@'%' IDENTIFIED BY 'some_pass'; | |
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; | |
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment