To begin editing privileges in MySQL, you must first login to your server and then connect to the Show
Typically the Connecting to the MySQL Command-Line ToolFor this example, we’ll assume 1), connect to your server as the root user, then issue the mysql command:
If successful, you’ll see some output about your MySQL connection and be facing down the Note: In the event that you’re unable to connect directly to the server as the 7 flag:
Granting PrivilegesNow that you are at the 1 prompt, you need only issue the 9 command with the necessary options to apply the appropriate permissions.Privilege TypesThe 9 command is capable of applying a wide variety of privileges, everything from the ability to 1 tables and databases, read or write 2, and even 3 the server. There are a wide range of flags and options available to the command, so you may wish to familiarize yourself with what 9 can actually do by browsing through the official documentation.Database-Specific PrivilegesIn most cases, you’ll be granting privileges to MySQL users based on the particular 5 that account should have access to. It is common practice, for example, for each unique MySQL 5 on a server to have its own unique 7 associated with it, such that only one single 7 has authentication access to one single 5 and vice-versa.To 0 privileges to a 7, allowing that user full control over a specific 5, use the following syntax:
With that command, we’ve told MySQL to:
Rather than providing all privileges to the entire database, perhaps you want to give the 4 user only the ability to read data ( 5) from the 6 table of the 7 database. That would be easily accomplished like so:
Creating Another Super UserWhile 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 7 with the wildcard asterisk:
Now 4 has the same privileges as the default root account, beware!Saving Your ChangesAs a final step following any updates to the user privileges, be sure to save the changes by issuing the 1 command from the mysql prompt:
Apa yang dimaksud dengan hak akses privileges pada MySQL?Secara singkat, maksud User Privilege MySQL adalah hak akses yang diberikan untuk pengguna tertentu agar bisa mengakses database beserta isinya di MySQL. Hak akses ini bersifat custom, artinya masing-masing pengguna bisa punya privilege yang berbeda.
Bagaimana cara membuat hak akses user di MySQL?Cara Membuat Hak Akses Tertentu untuk User MySQL. CREATE – memperbolehkan user untuk membuat database atau tabel.. SELECT – memperbolehkan user untuk mengambil data.. INSERT – memperbolehkan user untuk memodifikasi entri yang ada di tabel.. DELETE – memperbolehkan user untuk menghapus entri tabel.. Jelaskan hak akses privileges apa sajakah yang bisa diberikan pada user?hak_akses adalah privileges yang akan berikan kepada user tersebut. Hak akses disini berisi query yang diperbolehkan, seperti: SELECT, INSERT, UPDATE, DELETE, atau query lainnya. Jika kita ingin memberikan hak penuh untuk semua query dasar tersebut, hak_akses ini bisa diisi dengan ALL.
Apa yang dimaksud with grant option?GRANT OPTION adalah perintah yang dituliskan jika kita mengizinkan user tersebut bisa memberikan hak akses kepada user lainnya. nama_database adalah nama database yang ingin diberikan hak akses.
|