From 54c02cf16a7d02c7cf346ea3506b0c0a6b42ab82 Mon Sep 17 00:00:00 2001 From: zcp100_zcp100 Date: Wed, 3 Aug 2022 17:09:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E4=BB=80=E4=B9=88=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=E7=9B=AE=E6=A0=87=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...07\346\225\260\346\215\256\345\272\223.md" | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 "content/zh/post/zhangcuiping/\344\270\272\344\273\200\344\271\210\346\227\240\346\263\225\345\210\207\346\215\242\345\210\260\347\233\256\346\240\207\346\225\260\346\215\256\345\272\223.md" diff --git "a/content/zh/post/zhangcuiping/\344\270\272\344\273\200\344\271\210\346\227\240\346\263\225\345\210\207\346\215\242\345\210\260\347\233\256\346\240\207\346\225\260\346\215\256\345\272\223.md" "b/content/zh/post/zhangcuiping/\344\270\272\344\273\200\344\271\210\346\227\240\346\263\225\345\210\207\346\215\242\345\210\260\347\233\256\346\240\207\346\225\260\346\215\256\345\272\223.md" new file mode 100644 index 00000000..e02c011b --- /dev/null +++ "b/content/zh/post/zhangcuiping/\344\270\272\344\273\200\344\271\210\346\227\240\346\263\225\345\210\207\346\215\242\345\210\260\347\233\256\346\240\207\346\225\260\346\215\256\345\272\223.md" @@ -0,0 +1,55 @@ +title = "为什么无法切换到目标数据库" + +date = "2022-07-14" + +tags = ["为什么无法切换到目标数据库"] + +archives = "2022-07" + +author = "张翠娉" + +summary = "为什么无法切换到目标数据库" + +img = "/zh/post/zhangcuiping/title/img.png" + +times = "14:20" + ++++ + +# 为什么无法切换到目标数据库? + +**背景介绍**: + +在执行数据库相关操作时,发现无法切换到目标数据库。 + +**报错内容**: + +```bash +[ommdoc@hostname]$ gsql -d postgres -p 28000 +gsql ((MogDB 3.0.0 build 62408a0f) compiled at 2022-06-30 15:06:56 commit 0 last mr ) +Non-SSL connection (SSL connection is recommended when requiring high-security) +Type "help" for help. + +MogDB=# \c mogdb +Non-SSL connection (SSL connection is recommended when requiring high-security) +You are now connected to database "mogdb" as user "ommdoc". +mogdb=# \c MogDB +Non-SSL connection (SSL connection is recommended when requiring high-security) +You are now connected to database "mogdb" as user "ommdoc". +mogdb=# +``` + +**报错原因**: + +初始化库名时,只是把原来初始化的postgres库名,在客户端gsql上替换成了MogDB而已。实际上在数据库系统表和内部,其实是postgres库。 + +**解决办法**: + +执行以下命令进行切换: + +```bash +mogdb=# \c postgres +Non-SSL connection (SSL connection is recommended when requiring high-security) +You are now connected to database "postgres" as user "ommdoc". +MogDB=# +``` \ No newline at end of file -- Gitee