Difference between revisions of "MySQL"

From Catatan IBM
Jump to navigation Jump to search
(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...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
==GRANT ALL PRIVILEGES di MySQL 8==
*[[MySQL: Grant all Privileges di MySQL 8]]
 
*[[MySQL: Import and Export Databases in MySQL or MariaDB]]
Buat yang biasa pakai MySQL versi sebelum 8, membuat user otomatis dan sekaligus meng-assign privileges biasanya cukup dilakukan dengan satu perintah:
*[[MySQL: Buat User dan Database]]
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.

Latest revision as of 21:34, 19 June 2023