{"id":5019,"date":"2021-03-08T09:00:21","date_gmt":"2021-03-08T01:00:21","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=5019"},"modified":"2023-05-15T10:25:43","modified_gmt":"2023-05-15T02:25:43","slug":"gbase-8a-v95%e8%ae%be%e7%bd%ae%e6%9b%b4%e6%94%b9%e6%95%b0%e6%8d%ae%e5%ba%93%e7%94%a8%e6%88%b7%e9%bb%98%e8%ae%a4vc%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/5019","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a V95\u8bbe\u7f6e\u66f4\u6539\u6570\u636e\u5e93\u7528\u6237\u9ed8\u8ba4VC\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4V95\u7248\u672c\u5f00\u59cb\u652f\u6301\u865a\u62df\u96c6\u7fa4\uff0c\u6bcf\u4e2a\u65b0\u5efa\u7684\u6570\u636e\u5e93\u7528\u6237\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u9ed8\u8ba4\u7684VC\uff0c\u672c\u6587\u4ecb\u7ecd\u8bbe\u7f6e\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2abfe3a4afd\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2abfe3a4afd\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/5019\/#%E8%AF%AD%E6%B3%95\" >\u8bed\u6cd5<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/5019\/#%E8%AE%BE%E7%BD%AE%E9%BB%98%E8%AE%A4vc\" >\u8bbe\u7f6e\u9ed8\u8ba4vc<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/5019\/#%E8%AF%B4%E6%98%8E\" >\u8bf4\u660e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/5019\/#%E6%A0%B7%E4%BE%8B\" >\u6837\u4f8b<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AF%AD%E6%B3%95\"><\/span>\u8bed\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AE%BE%E7%BD%AE%E9%BB%98%E8%AE%A4vc\"><\/span>\u8bbe\u7f6e\u9ed8\u8ba4vc<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>set default_vc for user_name = vc_name<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AF%B4%E6%98%8E\"><\/span>\u8bf4\u660e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>default_vc \u662f\u5173\u952e\u5b57\uff0c\u53ef\u4ee5\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u8fdb\u884c\u8bbe\u7f6e\u3002<br>user_name \u662f\u8bbe\u7f6e\u9ed8\u8ba4VC\u7684\u6570\u636e\u5e93\u7528\u6237\u540d<br>vc_name \u662fvc\u7684\u540d\u5b57\u3002<\/p>\n\n\n\n<p>\u6bcf\u4e2a\u7528\u6237\u53ea\u80fd\u67091\u4e2a\u9ed8\u8ba4VC\uff0c\u8be5\u7528\u6237\u5728\u767b\u5f55\u65f6\uff0c\u5982\u679c\u6307\u5b9a\u4e86\u7528\u6237\u81ea\u5efa\u7684\u6570\u636e\u5e93\u800c\u6ca1\u6709vc\u90e8\u5206\uff0c\u5219\u4f7f\u7528\u9ed8\u8ba4\u7684VC\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%A0%B7%E4%BE%8B\"><\/span>\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5982\u4e0b\u6837\u4f8b\u8bbe\u7f6etestdb\u7528\u6237\u7684\u9ed8\u8ba4vc\u662fvc01\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>&#91;gbase@gbase_rh7_001 ~]$ gccli\n\nGBase client 9.5.2.36.125743. Copyright (c) 2004-2021, GBase.  All Rights Reserved.\n\ngbase&gt; set default_vc for testdb=vc01;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.01)\n\ngbase&gt; show grants for testdb;\n+------------------------------------------------------------------------------------------------------------------------------+\n| Grants for testdb@%                                                                                                          |\n+------------------------------------------------------------------------------------------------------------------------------+\n| GRANT USAGE ON *.*.* TO 'testdb'@'%' IDENTIFIED BY PASSWORD '*9EC001FF562CDE467D041CEAB13160F3BBB49DD2' WITH TASK_PRIORITY 2 |\n| GRANT ALL PRIVILEGES ON \"vc00001\".\"testdb\".* TO 'testdb'@'%'                                                                 |\n+------------------------------------------------------------------------------------------------------------------------------+\n2 rows in set (Elapsed: 00:00:00.00)\n\ngbase&gt; ^CAborted\n&#91;gbase@gbase_rh7_001 ~]$ gccli -utestdb -ptestdb testdb\n\nGBase client 9.5.2.36.125743. Copyright (c) 2004-2021, GBase.  All Rights Reserved.\n\ngbase&gt;\n<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u5176\u4e2d\u7684vc0001\u662fvc\u7684ID,\u800c\u6211\u4eec\u8bbe\u7f6e\u65f6\u7528\u7684\u65f6vcname\u3002vcid\u662f\u81ea\u52a8\u751f\u6210\u7684\uff0cvcname\u662f\u5728\u521b\u5efavc\u65f6\u7528\u6237\u6307\u5b9a\u7684\u3002\u800cvcname\u53ef\u4ee5\u4ee5\u901a\u8fc7gcadmin renamevc\u6539\u540d\uff0cvcid\u5219\u4e0d\u53d8\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase&gt; show vcs;\n+---------+------+---------+\n| id      | name | default |\n+---------+------+---------+\n| vc00001 | vc01 |         |\n| vc00002 | vc02 |         |\n+---------+------+---------+\n2 rows in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<p>\u5982\u4e0b\u6837\u4f8b\u66f4\u6539testdb\u7684\u9ed8\u8ba4vc\u662fvc02\uff0c\u4f46\u7531\u4e8etestdb\u6ca1\u6709vc02\u7684\u7528\u6237\u6570\u636e\u5e93\u8bbf\u95ee\u6743\u9650\uff0c\u76f4\u63a5\u62a5\u9519\u3002\u4f46\u53ef\u4ee5\u767b\u5f55\uff0c\u4e14\u8bbf\u95ee\u5143\u6570\u636e\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase> set default_vc for testdb=vc02;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.02)\n\ngbase> show vcs;\r\n+---------+------+---------+\r\n| id      | name | default |\r\n+---------+------+---------+\r\n| vc00001 | vc01 |         |\r\n| vc00002 | vc02 |    Y    |\r\n+---------+------+---------+\r\n2 rows in set (Elapsed: 00:00:00.00)\n\ngbase> ^CAborted\n&#91;gbase@gbase_rh7_001 ~]$ gccli -utestdb -ptestdb\n\nGBase client 9.5.2.36.125743. Copyright (c) 2004-2021, GBase.  All Rights Reserved.\n\ngbase> show tables;\nERROR 1046 (3D000): No database selected\ngbase> use testdb\n    -> ;\nERROR 1044 (42000): Access denied for user 'testdb'@'%' to database 'testdb'\ngbase> sho^CAborted\n\n&#91;gbase@gbase_rh7_001 ~]$ gccli -utestdb -ptestdb testdb\nERROR 1044 (42000): Access denied for user 'testdb'@'%' to database 'testdb'\n&#91;gbase@gbase_rh7_001 ~]$ <\/code><\/pre>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4V95\u7248\u672c\u5f00\u59cb\u652f\u6301\u865a\u62df\u96c6\u7fa4\uff0c\u6bcf\u4e2a\u65b0\u5efa\u7684\u6570\u636e\u5e93\u7528\u6237\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u9ed8\u8ba4\u7684VC\uff0c\u672c\u6587\u4ecb\u7ecd\u8bbe\u7f6e\u7684\u65b9\u6cd5\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[60],"class_list":["post-5019","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-v95"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=5019"}],"version-history":[{"count":3,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5019\/revisions"}],"predecessor-version":[{"id":11867,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5019\/revisions\/11867"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=5019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=5019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=5019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}