{"id":3549,"date":"2019-10-25T03:15:10","date_gmt":"2019-10-25T03:15:10","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/?p=3549"},"modified":"2026-10-15T04:49:50","modified_gmt":"2026-10-15T04:49:50","slug":"how-create-mysql-user-and-grant-permissions","status":"publish","type":"post","link":"\/ng\/tutorials\/how-create-mysql-user-and-grant-permissions\/","title":{"rendered":"How to create a MySQL user and grant privileges"},"content":{"rendered":"<p class=\"wp-block-paragraph\">To create a MySQL user, connect to your MySQL server with an account that has the required permissions, use the <code>CREATE USER<\/code> command, and assign database privileges with <code>GRANT<\/code>. You can then check the user&rsquo;s access with <code>SHOW GRANTS<\/code>, remove permissions with <code>REVOKE<\/code>, or delete the account with <code>DROP USER<\/code>.<\/p><p class=\"wp-block-paragraph\">In this tutorial, you&rsquo;ll learn how to create and manage MySQL users through the command line, grant only the permissions they need, and restrict access to specific databases.<\/p><figure class=\"wp-block-image size-large\"><a data-click-id=\"hgr-post-content-link-assets-hostinger-com-content-tutorials-pdf-how-to-speed-up-y\" aria-label=\"How to Speed Up Your Website EN\" href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/How-to-Speed-Up-Your-Website-EN.pdf\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-69260\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><p>\n\n\n\n\n<\/p><h2 class=\"wp-block-heading h-t-title-2\" id=\"h-prerequisites-for-creating-a-mysql-user\">Prerequisites for creating a MySQL user<\/h2><p class=\"wp-block-paragraph\">Before creating a MySQL user, make sure you have a running MySQL server, command-line access, and an administrative account with permission to create users and grant privileges.<\/p><p class=\"wp-block-paragraph\">This tutorial uses a Linux VPS. Connect to your server through SSH, then access MySQL with an administrative account. For a password-based root account, use:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mysql -u root -p<\/pre><p class=\"wp-block-paragraph\">Depending on your server&rsquo;s authentication setup, you may need to use <code>sudo mysql<\/code> instead.<\/p><p class=\"wp-block-paragraph\">If you use Hostinger Web or Cloud hosting, you can create and manage database users through <strong>Websites &rarr; Dashboard &rarr; Databases &rarr; Management<\/strong>, without running these administrative SQL commands.<\/p><h2 id=\"h-how-to-create-a-mysql-user-account-and-grant-all-privileges\" class=\"wp-block-heading h-t-title-2\">How to create a MySQL user and grant privileges<\/h2><p class=\"wp-block-paragraph\">Just as you start using MySQL, you&rsquo;ll be given a username and a password. These initial credentials will grant you <strong>root<\/strong> access or full control of all your databases and tables.<\/p><p class=\"wp-block-paragraph\">However, there are times when you&rsquo;ll need to give the database access to someone else without granting them full control.<\/p><p class=\"wp-block-paragraph\">For instance, you hire developers to maintain your databases, but you don&rsquo;t want to provide them with the ability to delete or modify any sensitive information.<\/p><p class=\"wp-block-paragraph\">In that case, you should give them the credentials of a non-root user. This way, you can keep track of what the developers can and cannot do with your data.<\/p><p class=\"wp-block-paragraph\">In this part, we will explain how to create a user account in MySQL with all privileges to your database. In a practical sense, it&rsquo;s not wise to give full control to a non-root user. However, it&rsquo;s still a good entry-point to learn about user privileges.<\/p><p class=\"wp-block-paragraph\">To create a new user account in MySQL, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Access command line and enter MySQL server:\n<pre>mysql<\/pre>\n<\/li>\n\n\n\n<li>The script will return this result, which verifies that you are accessing a MySQL server.\n<pre>mysql&gt;<\/pre>\n<\/li>\n\n\n\n<li>Then, execute the following command: <pre><code>CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'strong_password';<\/code><\/pre><\/li>\n<\/ol><ol start=\"4\" class=\"wp-block-list\">\n<li><strong>new_user<\/strong>&nbsp;is the name we&rsquo;ve given to our new user account and the <strong>IDENTIFIED BY &lsquo;password&rsquo;<\/strong> section sets a passcode for this user. You can replace these values with your own, inside the quotation marks.<\/li>\n\n\n\n<li>In order to grant all privileges of the database for a newly created user, execute the following command: <pre><code>GRANT SELECT, INSERT, UPDATE ON example_db.* TO 'new_user'@'localhost';<\/code><\/pre><\/li>\n<\/ol><p class=\"wp-block-paragraph\">Replace <code>new_user<\/code> with your preferred username and <code>strong_password<\/code> with a secure password.<\/p><p class=\"wp-block-paragraph\">The <code>localhost<\/code> value restricts the account to local connections. If an application connects from another server, specify its hostname or IP address instead. Using <code>'new_user'@'%'<\/code> matches connections from any host, so prefer a specific host whenever possible.<\/p><p class=\"wp-block-paragraph\">If you&rsquo;re running a setup script that may execute more than once, you can use <code>CREATE USER IF NOT EXISTS<\/code> to avoid an error when the account already exists. This won&rsquo;t change an existing account&rsquo;s password or permissions.<\/p><p class=\"wp-block-paragraph\">This grants the user permission to read, add, and update records in <code>example_db<\/code> without giving access to other databases. Replace the database name and privileges according to your application&rsquo;s needs.<\/p><p class=\"wp-block-paragraph\">If the account requires all privileges within a particular database, use <code>GRANT ALL PRIVILEGES ON example_db.*<\/code> instead of granting privileges globally with <code>*.*<\/code>.<\/p><p class=\"wp-block-paragraph\">Once that is done, your new user account has the same access to the database as the root user.<\/p><h2 id=\"h-how-to-grant-privileges-separately-for-a-mysql-user\" class=\"wp-block-heading h-t-title-2\">How to grant specific MySQL privileges<\/h2><p class=\"wp-block-paragraph\">In this part, we will explain how to grant privileges separately for a user account in MySQL.<\/p><p class=\"wp-block-paragraph\">When specifying the database name and table name, separate them with a . (period) and no spaces. This will give the root user fine-grain control over certain data.<\/p><p class=\"wp-block-paragraph\">Also, replace the <strong>PERMISSION_TYPE<\/strong> value with the kind of access you want to grant to your new user account.<\/p><p class=\"wp-block-paragraph\">Here are the most used commands in MySQL:<\/p><ul class=\"wp-block-list\">\n<li><strong>CREATE<\/strong> &mdash; enable users to create a database or table<\/li>\n\n\n\n<li><strong>SELECT<\/strong> &mdash; permit users to retrieve data<\/li>\n\n\n\n<li><strong>INSERT<\/strong> &mdash; let users add new entries in tables<\/li>\n\n\n\n<li><strong>UPDATE<\/strong> &mdash; allow users to modify existing entries in tables<\/li>\n\n\n\n<li><strong>DELETE<\/strong> &mdash; enable users to erase table entries<\/li>\n\n\n\n<li><strong>DROP<\/strong> &mdash; let users delete entire database tables<\/li>\n<\/ul><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\"> Using the <strong>ALL PRIVILEGES<\/strong> permission type from before will allow all of the permissions listed above.  <\/p>\n                    <\/div>\n        \n\n\n\n<\/p><p class=\"wp-block-paragraph\">To use any of these options, simply replace <strong>PERMISSION_TYPE <\/strong>with the appropriate keyword. To apply multiple privileges, separate them with a comma. For example, we can assign <strong>CREATE<\/strong> and <strong>SELECT<\/strong> to our non-root MySQL user account with this command:<\/p><pre class=\"wp-block-preformatted ql-syntax\">GRANT CREATE, SELECT ON * . * TO 'user_name'@'localhost';\n<\/pre><p class=\"wp-block-paragraph\">Sometimes, you might come across a situation where you need to revoke given privileges from a user. You can do so by entering:<\/p><pre class=\"wp-block-preformatted ql-syntax\">REVOKE PERMISSION_TYPE ON database_name.table_name FROM &lsquo;user_name&rsquo;@&lsquo;localhost&rsquo;;\n<\/pre><p class=\"wp-block-paragraph\">For example, to withdraw all privileges for our non-root user we should use:<\/p><pre class=\"wp-block-preformatted ql-syntax\">REVOKE ALL PRIVILEGES ON * . * FROM 'user_name'@'localhost';\n<\/pre><p class=\"wp-block-paragraph\">Finally, you can entirely delete an existing user account by using the following command:<\/p><pre class=\"wp-block-preformatted ql-syntax\">DROP USER &lsquo;user_name&rsquo;@&lsquo;localhost&rsquo;;\n<\/pre><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\"> Remember, you need to have root access to run any of these commands. Be sure to execute <strong>FLUSH PRIVILEGES;<\/strong> command after making your changes <\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h2 id=\"h-how-to-display-account-privileges-for-a-mysql-user\" class=\"wp-block-heading h-t-title-2\">How to check MySQL user privileges<\/h2><p class=\"wp-block-paragraph\">In order to find what privileges have already been granted to a MySQL user, you can use the <strong>SHOW GRANTS<\/strong> command:<\/p><pre class=\"wp-block-preformatted\">SHOW GRANTS FOR 'ner)user'@'localhost';<\/pre><p class=\"wp-block-paragraph\">The output will look similar to this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">+---------------------------------------------------------------------------+\n| Grants for user_name@localhost                                             |\n+---------------------------------------------------------------------------+\n| GRANT USAGE ON *.* TO `new_user`@`localhost`|\n| GRANT SELECT, INSERT, UPDATE ON `example_db`.* TO `new_user`@`localhost`      |<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">+---------------------------------------------------------------------------+\n3 rows in set (0.00 sec)<\/pre><p class=\"wp-block-paragraph\"><code>SHOW GRANTS<\/code> displays the permissions assigned to the account. Review the results to confirm that the user has access only to the intended databases and operations.<\/p><figure class=\"wp-block-image size-full\"><a data-click-id=\"hgr-post-content-link-ng-web-hosting\" class=\"hgr-tutorials-cta hgr-tutorials-cta-web-hosting\" href=\"\/ng\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/public\" alt=\"Hostinger web hosting banner\" class=\"wp-image-98604\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading h-t-title-2\" id=\"h-how-to-revoke-mysql-user-privileges\">How to revoke MySQL user privileges<\/h2><p class=\"wp-block-paragraph\">To remove permissions from an existing MySQL user without deleting the account, use the <code>REVOKE<\/code> command.<\/p><p class=\"wp-block-paragraph\">For example, to remove permission to add and modify records in a specific database, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">REVOKE INSERT, UPDATE ON example_db.* FROM 'new_user'@'localhost';<\/pre><p class=\"wp-block-paragraph\">The user will retain any other privileges that haven&rsquo;t been revoked.<\/p><p class=\"wp-block-paragraph\">You can then run <code>SHOW GRANTS FOR 'new_user'@'localhost';<\/code> to verify the changes.<\/p><h2 class=\"wp-block-heading h-t-title-2\" id=\"h-how-to-delete-a-mysql-user\">How to delete a MySQL user<\/h2><p class=\"wp-block-paragraph\">If you no longer need a MySQL account, remove it using <code>DROP USER<\/code>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DROP USER 'new_user'@'localhost';<\/pre><p class=\"wp-block-paragraph\">This removes the account and its associated privileges without deleting the database or its tables.<\/p><p class=\"wp-block-paragraph\">You can also use <code>DROP USER IF EXISTS<\/code> to avoid an error if the specified account doesn&rsquo;t exist. Before deleting an account, make sure no applications or database objects still depend on it.<\/p><h2 class=\"wp-block-heading h-t-title-2\" id=\"h-next-steps-review-your-mysql-user-permissions\">Next steps: Review your MySQL user permissions<\/h2><p class=\"wp-block-paragraph\">After creating a MySQL user and granting the required permissions, run <code>SHOW GRANTS<\/code> to confirm which databases and operations the account can access.<\/p><p class=\"wp-block-paragraph\">Review existing accounts as well, especially those used by applications or developers. Remove unnecessary privileges with <code>REVOKE<\/code> and delete accounts that are no longer needed.<\/p><p class=\"wp-block-paragraph\">For better database security, give each account only the permissions it needs and restrict connections to trusted hosts whenever possible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To create a MySQL user, connect to your MySQL server with an account that has the required permissions, use the CREATE USER command, and assign database privileges with GRANT. You can then check the user&rsquo;s access with SHOW GRANTS, remove permissions with REVOKE, or delete the account with DROP USER. In this tutorial, you&rsquo;ll learn [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/how-create-mysql-user-and-grant-permissions\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to create a MySQL user and grant privileges","rank_math_description":"Learn how to create a MySQL user, grant database permissions, check access, revoke privileges, and delete users with step-by-step SQL commands.","rank_math_focus_keyword":"mysql create user","footnotes":""},"categories":[22670],"tags":[],"class_list":["post-3549","post","type-post","status-publish","format-standard","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-criar-usuario-mysql-e-conceder-privilegios\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/creer-un-utilisateur-mysql\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-crear-usuario-mysql\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-membuat-hak-akses-user-di-mysql\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-create-mysql-user-and-grant-permissions","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-crear-usuario-mysql\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-crear-usuario-mysql\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-crear-usuario-mysql\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-criar-usuario-mysql-e-conceder-privilegios\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/3549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=3549"}],"version-history":[{"count":37,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/3549\/revisions"}],"predecessor-version":[{"id":153820,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/3549\/revisions\/153820"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=3549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=3549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=3549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}