Minggu, 24 Juni 2018

How to update root password and create user MariaDb MySql command line

  Tidak ada komentar


MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> update user set password=PASSWORD('the_password') where User='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 4  Changed: 0  Warnings: 0

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> exit
Bye


How to Create read only user :

MariaDB [(none)]> GRANT SELECT ON *.* to haproxy@'%' IDENTIFIED BY 'the_password';
Query OK, 0 rows affected (0.00 sec)

Tidak ada komentar :

Posting Komentar