Sunday, December 15, 2019

MySQL - Create User and Grant All Privilege



1.      In command line, type the following command, replacing USERNAME with your username and password to connect your database:

            mysql -u USERNAME -p PASSWORD

2.      Create new user in MySQL and give it full access to one database
      To create user in MySQL/MariaDB, use CREATE USER syntax:

            CREATE USER 'admin'@'localhost' IDENTIFIED BY '1234';
            GRANT ALL PRIVILEGES ON * . * TO 'admin'@'localhost';


No comments:

Post a Comment