{"id":14659,"date":"2024-01-30T16:34:51","date_gmt":"2024-01-30T13:04:51","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=14659"},"modified":"2024-01-30T16:34:51","modified_gmt":"2024-01-30T13:04:51","slug":"how-to-create-a-new-user-and-grant-permissions-in-mysql-2","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/","title":{"rendered":"\u5982\u4f55\u5728 MySQL \u4e2d\u521b\u5efa\u65b0\u7528\u6237\u5e76\u6388\u4e88\u6743\u9650"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">\u4ecb\u7ecd<\/h2>\n<p>MySQL \u662f\u4e00\u6b3e\u5f00\u6e90\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u5b83\u901a\u5e38\u4f5c\u4e3a LAMP \u6280\u672f\u6808\uff08Linux\u3001Apache\u3001MySQL \u548c PHP\uff09\u7684\u4e00\u90e8\u5206\u4f7f\u7528\uff0c\u5e76\u4e14\u622a\u81f3\u64b0\u5199\u672c\u6587\u65f6\uff0c\u5b83\u662f\u4e16\u754c\u4e0a\u6700\u6d41\u884c\u7684\u5f00\u6e90\u6570\u636e\u5e93\u3002\u672c\u6307\u5357\u5c06\u89e3\u91ca\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 MySQL \u7528\u6237\uff0c\u5e76\u6388\u4e88\u5176\u6267\u884c\u5404\u79cd\u64cd\u4f5c\u6240\u9700\u7684\u6743\u9650\u3002.<\/p>\n<h2 id=\"%d9%be%db%8c%d8%b4-%d9%86%db%8c%d8%a7%d8%b2%d9%87%d8%a7\">\u5148\u51b3\u6761\u4ef6<\/h2>\n<p>\u8981\u9075\u5faa\u672c\u6307\u5357\uff0c\u60a8\u9700\u8981\u8bbf\u95ee MySQL \u6570\u636e\u5e93\u3002\u672c\u6307\u5357\u5047\u8bbe\u6570\u636e\u5e93\u5b89\u88c5\u5728\u8fd0\u884c Ubuntu 20.04 \u7684\u865a\u62df\u4e13\u7528\u670d\u52a1\u5668\u4e0a\uff0c\u4f46\u65e0\u8bba\u60a8\u5982\u4f55\u8bbf\u95ee\u6570\u636e\u5e93\uff0c\u672c\u6307\u5357\u4e2d\u89e3\u91ca\u7684\u539f\u7406\u90fd\u9002\u7528\u3002\u5982\u679c\u60a8\u6ca1\u6709 MySQL \u6570\u636e\u5e93\u7684\u8bbf\u95ee\u6743\u9650\uff0c\u5e76\u4e14\u60f3\u8981\u81ea\u884c\u8bbe\u7f6e\uff0c\u60a8\u53ef\u4ee5\u53c2\u8003\u6211\u4eec\u63d0\u4f9b\u7684 MySQL \u5b89\u88c5\u6307\u5357\u3002\u540c\u6837\uff0c\u65e0\u8bba\u60a8\u7684\u670d\u52a1\u5668\u5e95\u5c42\u64cd\u4f5c\u7cfb\u7edf\u662f\u4ec0\u4e48\uff0c\u521b\u5efa\u65b0\u7684 MySQL \u7528\u6237\u5e76\u6388\u4e88\u5176\u6743\u9650\u7684\u6b65\u9aa4\u901a\u5e38\u90fd\u662f\u76f8\u540c\u7684\u3002.<\/p>\n<h2 id=\"%d8%a7%db%8c%d8%ac%d8%a7%d8%af-%db%8c%da%a9-%da%a9%d8%a7%d8%b1%d8%a8%d8%b1-%d8%ac%d8%af%db%8c%d8%af\">\u521b\u5efa\u65b0\u7528\u6237<\/h2>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0cMySQL \u4f1a\u521b\u5efa\u4e00\u4e2a root \u7528\u6237\u5e10\u6237\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u8be5\u5e10\u6237\u7ba1\u7406\u6570\u636e\u5e93\u3002\u6b64\u7528\u6237\u62e5\u6709 MySQL \u670d\u52a1\u5668\u7684\u5168\u90e8\u6743\u9650\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u53ef\u4ee5\u5b8c\u5168\u63a7\u5236\u6bcf\u4e2a\u6570\u636e\u5e93\u3001\u8868\u3001\u7528\u6237\u7b49\u3002\u56e0\u6b64\uff0c\u6700\u597d\u907f\u514d\u5c06\u6b64\u5e10\u6237\u7528\u4e8e\u7ba1\u7406\u529f\u80fd\u4e4b\u5916\u7684\u5176\u4ed6\u7528\u9014\u3002\u672c\u6b65\u9aa4\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 MySQL root \u7528\u6237\u521b\u5efa\u65b0\u7528\u6237\u5e10\u6237\u5e76\u6388\u4e88\u5176\u6743\u9650\u3002.<\/p>\n<p>\u5728\u8fd0\u884c MySQL 5.7\uff08\u53ca\u66f4\u9ad8\u7248\u672c\uff09\u7684 Ubuntu \u7cfb\u7edf\u4e0a\uff0cMySQL root \u7528\u6237\u9ed8\u8ba4\u4f7f\u7528 auth_socket \u63d2\u4ef6\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u800c\u4e0d\u662f\u5bc6\u7801\u3002\u8be5\u63d2\u4ef6\u8981\u6c42\u8c03\u7528 MySQL \u5ba2\u6237\u7aef\u7684\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u4e0e\u547d\u4ee4\u4e2d\u6307\u5b9a\u7684 MySQL \u7528\u6237\u540d\u5339\u914d\u3002\u8fd9\u610f\u5473\u7740\u60a8\u5fc5\u987b\u5728 mysql \u547d\u4ee4\u524d\u52a0\u4e0a sudo\uff0c\u624d\u80fd\u4ee5 Ubuntu root \u7528\u6237\u7684\u6743\u9650\u8c03\u7528\u8be5\u547d\u4ee4\uff0c\u4ece\u800c\u83b7\u5f97\u5bf9 MySQL root \u7528\u6237\u7684\u8bbf\u95ee\u6743\u9650\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo mysql<\/code><\/pre>\n<\/div>\n<p>\u5982\u679c\u60a8\u7684 MySQL root \u7528\u6237\u914d\u7f6e\u4e86\u5bc6\u7801\u9a8c\u8bc1\uff0c\u5219\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u547d\u4ee4\u6765\u8bbf\u95ee MySQL shell\u3002\u4ee5\u4e0b\u547d\u4ee4\u5c06\u4ee5\u666e\u901a\u7528\u6237\u6743\u9650\u8fd0\u884c MySQL \u5ba2\u6237\u7aef\uff0c\u60a8\u53ea\u9700\u4f7f\u7528\u6b63\u786e\u7684\u5bc6\u7801\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u5373\u53ef\u83b7\u5f97\u6570\u636e\u5e93\u7684\u7ba1\u7406\u5458\u6743\u9650\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>mysql -u root -p<\/code><\/pre>\n<\/div>\n<p>\u4e00\u65e6\u60a8\u83b7\u5f97 MySQL \u63d0\u793a\u7b26\u7684\u8bbf\u95ee\u6743\u9650\uff0c\u60a8\u5c31\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u77ed\u8bed\u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237 <code>\u521b\u5efa\u7528\u6237<\/code> \u521b\u5efa\u3002\u8fd9\u4e9b\u547d\u4ee4\u9075\u5faa\u4ee5\u4e0b\u901a\u7528\u8bed\u6cd5\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>CREATE USER 'username'@'host' IDENTIFIED WITH authentication_plugin BY 'password';<\/code><\/pre>\n<\/div>\n<p>\u540e <code>\u521b\u5efa\u7528\u6237<\/code> \u60a8\u9700\u8981\u6307\u5b9a\u7528\u6237\u540d\u3002\u7528\u6237\u540d\u540e\u7d27\u8ddf\u4e00\u4e2a @ \u7b26\u53f7\uff0c\u7136\u540e\u662f\u8be5\u7528\u6237\u5c06\u8981\u8fde\u63a5\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u60a8\u4ec5\u6253\u7b97\u4ece Ubuntu \u670d\u52a1\u5668\u672c\u5730\u8bbf\u95ee\u8be5\u7528\u6237\uff0c\u5219\u53ef\u4ee5\u6307\u5b9a localhost\u3002\u7528\u6237\u540d\u548c\u4e3b\u673a\u540d\u5e76\u975e\u603b\u662f\u9700\u8981\u7528\u5f15\u53f7\u62ec\u8d77\u6765\uff0c\u4f46\u8fd9\u6837\u505a\u6709\u52a9\u4e8e\u907f\u514d\u9519\u8bef\u3002.<\/p>\n<p>\u9009\u62e9\u7528\u6237\u8eab\u4efd\u9a8c\u8bc1\u63d2\u4ef6\u65f6\uff0c\u60a8\u6709\u591a\u79cd\u9009\u62e9\u3002\u63d2\u4ef6 <code>\u8ba4\u8bc1\u5957\u63a5\u5b57<\/code> \u5982\u524d\u6240\u8ff0\uff0c\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u5728\u4e8e\u5b83\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5b89\u5168\u6027\uff0c\u65e0\u9700\u7ecf\u8fc7\u8eab\u4efd\u9a8c\u8bc1\u7684\u7528\u6237\u8f93\u5165\u5bc6\u7801\u5373\u53ef\u8bbf\u95ee\u6570\u636e\u5e93\u3002\u4f46\u5b83\u4e5f\u963b\u6b62\u4e86\u8fdc\u7a0b\u8fde\u63a5\uff0c\u8fd9\u4f1a\u4f7f\u5916\u90e8\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u4e0e MySQL \u4ea4\u4e92\u65f6\u53d8\u5f97\u590d\u6742\u3002.<\/p>\n<p>\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5b8c\u5168\u7701\u7565\u8bed\u6cd5\u4e2d\u7684 `WITH authentication_plugin` \u90e8\u5206\uff0c\u8ba9\u7528\u6237\u4f7f\u7528\u9ed8\u8ba4\u7684 MySQL \u63d2\u4ef6 `caching_sha2_password` \u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u3002MySQL \u6587\u6863\u5efa\u8bae\u5e0c\u671b\u4f7f\u7528\u5bc6\u7801\u767b\u5f55\u7684\u7528\u6237\u4f7f\u7528\u6b64\u63d2\u4ef6\uff0c\u56e0\u4e3a\u5b83\u5177\u6709\u5f3a\u5927\u7684\u5b89\u5168\u7279\u6027\u3002.<\/p>\n<p>\u8981\u521b\u5efa\u4f7f\u7528 caching_sha2_password \u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u7684\u7528\u6237\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\u8bf7\u786e\u4fdd <code>\u8428\u7c73<\/code> \u4e3a\u60a8\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u9009\u62e9\u4e00\u4e2a\u5f3a\u5bc6\u7801\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\">CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';<\/pre>\n<\/div>\n<p>\u67d0\u4e9b PHP \u7248\u672c\u5b58\u5728\u4e00\u4e2a\u5df2\u77e5\u95ee\u9898\uff0c\u4f1a\u5bfc\u81f4 caching_sha2_password \u51fd\u6570\u5931\u6548\u3002\u5982\u679c\u60a8\u8ba1\u5212\u5c06\u6b64\u6570\u636e\u5e93\u4e0e PHP \u5e94\u7528\u7a0b\u5e8f\uff08\u4f8b\u5982 phpMyAdmin\uff09\u4e00\u8d77\u4f7f\u7528\uff0c\u5219\u53ef\u80fd\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u4f7f\u7528\u8f83\u65e7\u4f46\u4ecd\u7136\u5b89\u5168\u7684 mysql_native_password \u6269\u5c55\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u7684\u7528\u6237\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>CREATE USER 'sammy'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';<\/code><\/pre>\n<\/div>\n<p>\u5982\u679c\u60a8\u4e0d\u786e\u5b9a\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u4f7f\u7528 caching_sha2_plugin \u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u7684\u7528\u6237\uff0c\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u66f4\u6539\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>ALTER USER 'sammy'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';<\/code><\/pre>\n<\/div>\n<p>\u521b\u5efa\u65b0\u7528\u6237\u540e\uff0c\u60a8\u53ef\u4ee5\u4e3a\u5176\u6388\u4e88\u76f8\u5e94\u7684\u6743\u9650\u3002.<\/p>\n<h2 id=\"%d8%a7%d8%b9%d8%b7%d8%a7%db%8c-%d9%85%d8%ac%d9%88%d8%b2%d9%87%d8%a7%db%8c-%da%a9%d8%a7%d8%b1%d8%a8%d8%b1\">\u6388\u4e88\u7528\u6237\u6743\u9650<\/h2>\n<p>\u6388\u4e88\u7528\u6237\u6743\u9650\u7684\u901a\u7528\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>GRANT PRIVILEGE ON database.table TO 'username'@'host';<\/code><\/pre>\n<\/div>\n<p>\u672c\u793a\u4f8b\u8bed\u6cd5\u4e2d\u7684 PRIVILEGE \u503c\u6307\u5b9a\u4e86\u7528\u6237\u53ef\u4ee5\u5bf9\u6307\u5b9a\u7684\u6570\u636e\u5e93\u548c\u8868\u6267\u884c\u54ea\u4e9b\u64cd\u4f5c\u3002\u60a8\u53ef\u4ee5\u5728\u4e00\u6761\u8bed\u53e5\u4e2d\u6388\u4e88\u7528\u6237\u591a\u4e2a\u6743\u9650\uff0c\u53ea\u9700\u7528\u9017\u53f7\u5206\u9694\u5373\u53ef\u3002\u60a8\u8fd8\u53ef\u4ee5\u901a\u8fc7\u5728\u6570\u636e\u5e93\u548c\u8868\u540d\u4e2d\u8f93\u5165\u661f\u53f7 (*) \u6765\u6388\u4e88\u7528\u6237\u5168\u5c40\u6743\u9650\u3002\u5728 SQL \u4e2d\uff0c\u661f\u53f7\u662f\u7528\u4e8e\u8868\u793a\u201c\u6240\u6709\u201d\u6570\u636e\u5e93\u6216\u8868\u7684\u7279\u6b8a\u5b57\u7b26\u3002.<\/p>\n<p>\u4f8b\u5982\uff0c\u4ee5\u4e0b\u547d\u4ee4\u8d4b\u4e88\u7528\u6237\u521b\u5efa\u3001\u4fee\u6539\u548c\u5220\u9664\u6570\u636e\u5e93\u3001\u8868\u548c\u7528\u6237\u7684\u5168\u5c40\u6743\u9650\uff0c\u4ee5\u53ca\u5728\u670d\u52a1\u5668\u4e0a\u7684\u4efb\u4f55\u8868\u4e2d\u63d2\u5165\u3001\u66f4\u65b0\u548c\u5220\u9664\u6570\u636e\u7684\u6743\u9650\u3002\u5b83\u8fd8\u5141\u8bb8\u7528\u6237\u67e5\u8be2\u6570\u636e\u3002 <code>\u9009\u62e9<\/code> \u641c\u7d22\uff0c\u5e26\u6709\u5173\u952e\u5b57\u7684\u5916\u952e <code>\u53c2\u8003<\/code> \u521b\u5efa\u548c\u8fd0\u8425 <code>\u51b2\u6d17<\/code> \u79ef\u5206 <code>\u91cd\u65b0\u52a0\u8f7d<\/code> \u4f46\u662f\uff0c\u60a8\u5e94\u8be5\u53ea\u6388\u4e88\u7528\u6237\u4ed6\u4eec\u9700\u8981\u7684\u6743\u9650\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8c03\u6574\u7528\u6237\u6743\u9650\u3002.<\/p>\n<p>\u60a8\u53ef\u4ee5\u5728\u6b64\u5904\u67e5\u770b\u6240\u6709\u53ef\u7528\u79ef\u5206\u7684\u5b8c\u6574\u5217\u8868 <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/privileges-provided.html#privileges-provided-summary\">MySQL\u5b98\u65b9\u6587\u6863<\/a> \u627e\u5230\u5b83\u3002.<\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b GRANT \u8bed\u53e5\uff0c\u5c06 Sammy \u66ff\u6362\u4e3a\u60a8\u7684 MySQL \u7528\u6237\u540d\uff0c\u4ee5\u6388\u4e88\u60a8\u7684\u7528\u6237\u4ee5\u4e0b\u6743\u9650\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on *.* TO 'sammy'@'localhost' WITH GRANT OPTION;<\/code><\/pre>\n<\/div>\n<p>\u8bf7\u6ce8\u610f\uff0c\u6b64\u8bed\u53e5\u8fd8\u5305\u542b WITH GRANT \u9009\u9879\u3002\u8fd9\u5141\u8bb8\u60a8\u7684 MySQL \u7528\u6237\u5c06\u5176\u62e5\u6709\u7684\u4efb\u4f55\u6743\u9650\u6388\u4e88\u7cfb\u7edf\u4e0a\u7684\u5176\u4ed6\u7528\u6237\u3002.<\/p>\n<p>\u67d0\u4e9b\u7528\u6237\u53ef\u80fd\u5e0c\u671b\u6388\u4e88\u5176 MySQL \u7528\u6237\u6240\u6709\u6743\u9650\uff0c\u8fd9\u5c06\u8d4b\u4e88\u4ed6\u4eec\u7c7b\u4f3c\u4e8e root \u7528\u6237\u7684\u5e7f\u6cdb\u8d85\u7ea7\u7528\u6237\u6743\u9650\uff0c\u4f8b\u5982\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\">GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;<\/pre>\n<\/div>\n<p>\u4e0d\u5e94\u8f7b\u6613\u6388\u4e88\u5982\u6b64\u5e7f\u6cdb\u7684\u6743\u9650\uff0c\u56e0\u4e3a\u4efb\u4f55\u62e5\u6709\u6b64 MySQL \u7528\u6237\u8bbf\u95ee\u6743\u9650\u7684\u4eba\u90fd\u5c06\u5b8c\u5168\u63a7\u5236\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u3002.<\/p>\n<p>\u8bb8\u591a\u6307\u5357\u5efa\u8bae\u5728\u6267\u884c CREATE USER \u6216 GRANT \u8bed\u53e5\u540e\u7acb\u5373\u8fd0\u884c FLUSH PRIVILEGES \u547d\u4ee4\uff0c\u4ee5\u91cd\u65b0\u52a0\u8f7d\u6388\u6743\u8868\uff0c\u786e\u4fdd\u5e94\u7528\u65b0\u7684\u6743\u9650\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>FLUSH PRIVILEGES;<\/code><\/pre>\n<\/div>\n<p>\u7136\u800c\uff0c\u6839\u636e <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/privilege-changes.html\">MySQL\u5b98\u65b9\u6587\u6863<\/a>\u5f53\u60a8\u4f7f\u7528\u8bf8\u5982 GRANT \u4e4b\u7c7b\u7684\u8d26\u6237\u7ba1\u7406\u8bed\u53e5\u95f4\u63a5\u4fee\u6539\u6388\u6743\u8868\u65f6\uff0c\u6570\u636e\u5e93\u4f1a\u7acb\u5373\u5c06\u6388\u6743\u8868\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\uff0c\u8fd9\u610f\u5473\u7740\u5728\u672c\u4f8b\u4e2d\u4e0d\u9700\u8981\u6267\u884c FLUSH PRIVILEGES \u547d\u4ee4\u3002\u53e6\u4e00\u65b9\u9762\uff0c\u6267\u884c\u8be5\u547d\u4ee4\u4e5f\u4e0d\u4f1a\u5bf9\u7cfb\u7edf\u9020\u6210\u4efb\u4f55\u8d1f\u9762\u5f71\u54cd\u3002.<\/p>\n<p>\u5982\u679c\u9700\u8981\u64a4\u9500\u8bb8\u53ef\u8bc1\uff0c\u5176\u6d41\u7a0b\u4e0e\u6388\u4e88\u8bb8\u53ef\u8bc1\u7684\u6d41\u7a0b\u51e0\u4e4e\u76f8\u540c\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>REVOKE type_of_permission ON database_name.table_name FROM 'username'@'host';<\/code><\/pre>\n<\/div>\n<p>\u8bf7\u6ce8\u610f\uff0c\u64a4\u9500\u6743\u9650\u65f6\uff0c\u8bed\u6cd5\u8981\u6c42\u4f7f\u7528 `\\n` \u800c\u4e0d\u662f `\\n`\u3002 <code>\u5230<\/code>\u60a8\u5728\u6388\u4e88\u6743\u9650\u65f6\u4f7f\u7528\u7684 <code>\u4ece<\/code>\u4f7f\u7528\u3002.<\/p>\n<p>\u901a\u8fc7\u6267\u884c\u8be5\u547d\u4ee4 <code>\u5c55\u89c8\u8d44\u52a9<\/code> \u60a8\u53ef\u4ee5\u67e5\u770b\u7528\u6237\u7684\u5f53\u524d\u6743\u9650\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>SHOW GRANTS FOR 'username'@'host';<\/code><\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u6570\u636e\u5e93 <code>\u964d\u4f4e<\/code> \u5220\u9664\uff0c\u60a8\u53ef\u4ee5\u4ece <code>\u964d\u4f4e<\/code> \u8981\u5220\u9664\u7528\u6237\uff0c\u8bf7\u4f7f\u7528\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>DROP USER 'username'@'localhost';<\/code><\/pre>\n<\/div>\n<p>\u521b\u5efa MySQL \u7528\u6237\u5e76\u6388\u4e88\u5176\u6743\u9650\u540e\uff0c\u5373\u53ef\u9000\u51fa MySQL\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\">exit<\/pre>\n<\/div>\n<p>\u5c06\u6765\uff0c\u8981\u4ee5\u65b0\u7684 MySQL \u7528\u6237\u8eab\u4efd\u767b\u5f55\uff0c\u60a8\u5c06\u4f7f\u7528\u7c7b\u4f3c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>mysql -u sammy -p<\/code><\/pre>\n<\/div>\n<p>-p \u53c2\u6570\u4f1a\u4f7f MySQL \u5ba2\u6237\u7aef\u63d0\u793a\u60a8\u8f93\u5165 MySQL \u7528\u6237\u5bc6\u7801\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u3002.<\/p>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">\u7ed3\u679c<\/h2>\n<p>\u901a\u8fc7\u672c\u6559\u7a0b\uff0c\u60a8\u5b66\u4e60\u4e86\u5982\u4f55\u5728 MySQL \u6570\u636e\u5e93\u4e2d\u6dfb\u52a0\u65b0\u7528\u6237\u5e76\u6388\u4e88\u4ed6\u4eec\u5404\u79cd\u6743\u9650\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u53ef\u4ee5\u7ee7\u7eed\u63a2\u7d22\u548c\u5c1d\u8bd5\u4e0d\u540c\u7684 MySQL \u7528\u6237\u6743\u9650\u8bbe\u7f6e\uff0c\u6216\u8005\u60a8\u53ef\u80fd\u60f3\u4e86\u89e3\u66f4\u591a\u66f4\u9ad8\u7ea7\u7684 MySQL \u8bbe\u7f6e\u3002.<\/p>","protected":false},"excerpt":{"rendered":"\u7b80\u4ecb MySQL \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u5b83\u901a\u5e38\u7528\u4f5c\u2026\u2026\u7684\u4e00\u90e8\u5206\u3002","protected":false},"author":1,"featured_media":14660,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u0627\u06cc\u062c\u0627\u062f \u06a9\u0627\u0631\u0628\u0631\u062f \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193,349,204],"tags":[391,392],"class_list":{"0":"post-14659","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"category-database","9":"category-servers","10":"tag-mysql","11":"tag-392"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL - \u0628\u0644\u0627\u06af ITPiran<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 MySQL \u06cc\u06a9 \u0633\u06cc\u0633\u062a\u0645 \u0645\u062f\u06cc\u0631\u06cc\u062a \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0631\u0627\u0628\u0637\u0647 \u0627\u06cc \u0645\u0646\u0628\u0639 \u0628\u0627\u0632 \u0627\u0633\u062a. \u0645\u0639\u0645\u0648\u0644\u0627\u064b \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0628\u062e\u0634\u06cc \u0627\u0632 \u067e\u0634\u062a\u0647&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-30T13:04:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2024\/01\/30163320\/MySQL-BackG.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL\",\"datePublished\":\"2024-01-30T13:04:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/\"},\"wordCount\":86,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/01\\\/30163320\\\/MySQL-BackG.jpg\",\"keywords\":[\"MySQL\",\"\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\",\"\u0633\u0631\u0648\u0631\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/\",\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/01\\\/30163320\\\/MySQL-BackG.jpg\",\"datePublished\":\"2024-01-30T13:04:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/01\\\/30163320\\\/MySQL-BackG.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/01\\\/30163320\\\/MySQL-BackG.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/zh\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728 MySQL \u4e2d\u521b\u5efa\u65b0\u7528\u6237\u5e76\u6388\u4e88\u6743\u9650 - ITPiran \u535a\u5ba2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/","og_locale":"zh_CN","og_type":"article","og_title":"\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 MySQL \u06cc\u06a9 \u0633\u06cc\u0633\u062a\u0645 \u0645\u062f\u06cc\u0631\u06cc\u062a \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0631\u0627\u0628\u0637\u0647 \u0627\u06cc \u0645\u0646\u0628\u0639 \u0628\u0627\u0632 \u0627\u0633\u062a. \u0645\u0639\u0645\u0648\u0644\u0627\u064b \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0628\u062e\u0634\u06cc \u0627\u0632 \u067e\u0634\u062a\u0647&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2024-01-30T13:04:51+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2024\/01\/30163320\/MySQL-BackG.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL","datePublished":"2024-01-30T13:04:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/"},"wordCount":86,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/01\/30163320\/MySQL-BackG.jpg","keywords":["MySQL","\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc","\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647","\u0633\u0631\u0648\u0631"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/","name":"\u5982\u4f55\u5728 MySQL \u4e2d\u521b\u5efa\u65b0\u7528\u6237\u5e76\u6388\u4e88\u6743\u9650 - ITPiran \u535a\u5ba2","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/01\/30163320\/MySQL-BackG.jpg","datePublished":"2024-01-30T13:04:51+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2024\/01\/30163320\/MySQL-BackG.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2024\/01\/30163320\/MySQL-BackG.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u0646\u062d\u0648\u0647 \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0648 \u0627\u0639\u0637\u0627\u06cc \u0645\u062c\u0648\u0632 \u062f\u0631 MySQL"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"ITPiran\u535a\u5ba2","description":"\u4f0a\u6717\u53ef\u6301\u7eed\u8d38\u6613\u65b0\u95fb\u548c\u6587\u7ae0","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"\u4f0a\u6717\u53ef\u6301\u7eed\u5546\u4e1a\u535a\u5ba2","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"\u884c\u653f","url":"https:\/\/www.itpiran.net\/blog\/zh\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts\/14659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/comments?post=14659"}],"version-history":[{"count":1,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts\/14659\/revisions"}],"predecessor-version":[{"id":14661,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts\/14659\/revisions\/14661"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/media\/14660"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/media?parent=14659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/categories?post=14659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/tags?post=14659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}