MySQL
Revision as of 10:28, 28 January 2022 by Ibm (talk | contribs) (Created page with "==GRANT ALL PRIVILEGES di MySQL 8== Buat yang biasa pakai MySQL versi sebelum 8, membuat user otomatis dan sekaligus meng-assign privileges biasanya cukup dilakukan dengan satu perintah: GRANT ALL PRIVILEGES ON yourdbname.* TO yourdbuser@localhost IDENTIFIED BY ‘yourdbpassword’; Di MySQL 8 sintaks ini akan memberikan error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax...")
GRANT ALL PRIVILEGES di MySQL 8
Buat yang biasa pakai MySQL versi sebelum 8, membuat user otomatis dan sekaligus meng-assign privileges biasanya cukup dilakukan dengan satu perintah:
GRANT ALL PRIVILEGES ON yourdbname.* TO yourdbuser@localhost IDENTIFIED BY ‘yourdbpassword’;
Di MySQL 8 sintaks ini akan memberikan error:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘IDENTIFIED BY ‘yourdbpassword” at line 1
Solusinya:
CREATE USER ‘yourdbuser’@’localhost’ IDENTIFIED BY ‘yourdbpassword’;
GRANT ALL PRIVILEGES ON yourdbname.* TO ‘yourdbuser’@’localhost’ WITH GRANT OPTION;
Tentu pastikan database nya sudah terbuat dahulu. Oiya behaviour lainnya adalah root mysql hanya bisa diakses dari user root dan bisa dilakukan tanpa password.