Menambahkan super user di mysql

9.7.18 Ilham S.Putra 0 Comments

CREATING ANOTHER SUPER USER

Login ke mysql dengan akses root :
sudo mysql -u root -p
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
While not particularly secure, in some cases you may wish to create another ‘super user’, that has ALL privileges across ALL databases on the server. That can be performed similar to above, but by replacing the database_name with the wildcard asterisk:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';
Now username has the same privileges as the default root account, beware!

SAVING YOUR CHANGES

As a final step following any updates to the user privileges, be sure to save the changes by issuing the FLUSH PRIVILEGES command from the mysql prompt:
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

0 komentar: