GreatSQL社区

搜索

reddey

安装Greatsql 的MYSHELL SHELL报错

reddey 已有 388 次阅读2024-5-27 08:56 |系统分类:故障排错

由于社区中MYSHELL SHELL版本是2.28,我特意安装了一台ORALCE LINUX 8虚拟机。

cat /etc/redhat-release

Red Hat Enterprise Linux release 8.9 (Ootpa)

ldd --version

ldd (GNU libc) 2.28

Copyright (C) 2018 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Written by Roland McGrath and Ulrich Drepper.

在使用社区的MYSQL SHELL时,

./mysqlsh

Python path configuration:

 PYTHONHOME = '/usr/bin/python3'

 PYTHONPATH = (not set)

 program name = '/root/greatsql-shell-8.0.32-25-glibc2.28-x86_64/bin/mysqlsh'

 isolated = 0

 environment = 1

 user site = 1

 import site = 1

 sys._base_executable = '/root/greatsql-shell-8.0.32-25-glibc2.28-x86_64/bin/mysqlsh'

 sys.base_prefix = '/usr/bin/python3'

 sys.base_exec_prefix = '/usr/bin/python3'

 sys.executable = '/root/greatsql-shell-8.0.32-25-glibc2.28-x86_64/bin/mysqlsh'

 sys.prefix = '/usr/bin/python3'

 sys.exec_prefix = '/usr/bin/python3'

 sys.path = [

   '/usr/bin/python3/lib64/python38.zip',

   '/usr/bin/python3/lib64/python3.8',

   '/usr/bin/python3/lib64/python3.8/lib-dynload',

 ]

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

Python runtime state: core initialized

ModuleNotFoundError: No module named 'encodings'


Current thread 0x00007f78e3b8ef80 (most recent call first):

从上面的报错看,是python有问题。我安装的python3

在Greatsql社区发帖子咨询,叶金荣老师很快就回复了解决办法。作为开源社区,技术人员回复速度如此之快,确实少见。

解决方法如下:

# 先安装几个必要的依赖包

$ dnf install -y libssh python38 python38-libs python38-pyyaml

$ pip3.8 install --user certifi pyclamd


# 测试使用

$ /usr/local/greatsql-shell-8.0.32-25-centos-glibc2.28-x86_64/bin/mysqlsh

MySQL Shell 8.0.32

...

Type '\help' or '\?' for help; '\quit' to exit.

MySQL  JS > \q

Bye!

按照上面的方面处理,果然解决问题了。

./mysqlsh

MySQL Shell 8.0.32


Copyright (c) 2016, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

Other names may be trademarks of their respective owners.


Type '\help' or '\?' for help; '\quit' to exit.

WARNING: Found errors loading plugins, for more details look at the log at: /root/.mysqlsh/mysqlsh.log

MySQL  JS > \py\

Unknown command: '\py\'

MySQL  JS > \py

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-9-8 10:15 , Processed in 0.015188 second(s), 9 queries , Redis On.
返回顶部