打开终端,查看当前使用的内核;
4 uname -r
5 cat /etc/redhat-release
先更新
6 yum -y update
导入ELRepo仓库的公共密钥
7 rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
安装ELRepo仓库的yum源
8 rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
查询可用内核版本
9 yum –disablerepo=“*” –enablerepo=“elrepo-kernel” list available
安装最新的稳定版本内核
10 yum –enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml -y
查看系统上的所有可用内核:
11 awk -F’ ‘$1==”menuentry ” {print $2}’ /etc/grub2.cfg
12 sudo awk -F’ ‘$1==”menuentry ” {print i++ ” : ” $2}’ /etc/grub2.cfg
通过 grub2-set-default 0 命令设置
13 grub2-set-default 0
编辑(e)将GRUB_DEFAULT设置为0,如下
14 vim /etc/default/grub
生成 grub 配置文件并重启
17 grub2-mkconfig -o /boot/grub2/grub.cfg
18 reboot
19 uname -r
删除旧内核
20 rpm -qa | grep kernel
21 yum remove kernel-3* kernel-tools-3*
22 rpm -qa | grep kernel
23 yum -y remove kernel-tools-libs-3.10.0-1160.76.1.el7.x86_64
24 reboot
25 uname -r
26 grub2-set-default 0
27 grub2-mkconfig -0 /boot/grub2/grub.cfg
28 reboot -h now
29 history
查看所有内核选项;
rpm -qa|grep kernel
grub2-set-default 0
进入root模式,删除多余内核;
yum remove 多余内核
重新编译引导;
grub2-mkconfig -o /boot/grub2/grub.cfg
重启;
reboot
安装mysql8.0
https://zhuanlan.zhihu.com/p/
navicat连接报错:Authentication plugin ‘caching_sha2_password’ cannot be loaded的处理方法 – 知乎 https://zhuanlan.zhihu.com/p/
使用Navicat12连接数据库,输入root密码后出现2059 – Authentication plugin ‘caching_sha2_password’ cannot be loaded报错,找了半天原因是MySQL8之前和之后的加密规则不同导致的,现在来处理这个问题。
1.打开MySQL的命令行,输入数据库密码
2.修改加密规则:ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER;
3.更新用户密码:ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;
4.刷新权限: FLUSH PRIVILEGES;
5.重置密码:ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘新密码’
这个时候就完成了修改,打开navicat连接数据库,输入新密码,就会显示连接成功
以上不行
使用下面的命令
进入mysql数据库
use mysql;
通过命令 select user,plugin from user where user=‘root’; 我们可以发现加密方式是caching_sha2_password
然后使用命令:alter user ‘root’@‘%’ identified with mysql_native_password by ‘your password’;
alter user ‘root’@‘%’ identified with mysql_native_password by ‘1qaz!@#$’;
再次查看,就发现加密方式已经更改:
select user,plugin from user where user=‘root’;
接着找到my.cnf文件(不知道目录的可以通过brew list mysql来确定目录)并加上加密方式:
default_authentication_plugin=mysql_native_password
刷新
flush privileges;
成功
重置mysql8.0密码
1.开启两个窗口
窗口一 root@zabbix-server01:~# mysqld -nt –skip-grant-tables 跳过验证。
窗口二 root@zabbix-server01:~# mysql -u root -p
Enter password: 不要输入任何,直接回车,进入。
2.更新mysql密码
mysql> ALTER user ‘root’@‘%’ IDENTIFIED BY ‘2022@H*’;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
密码更新完成,重启mysql服务,使用新密码登录进去
安装python3
yum -y install python36
安装pip
升级pip3:
1.sudo wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
2.sudo python3 get-pip.py
3.pip -V
[root@localhost ~]# wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
–2022-06-02 15:50:48– https://bootstrap.pypa.io/pip/3.5/get-pip.py
正在解析主机 bootstrap.pypa.io (bootstrap.pypa.io)… 151.101.108.175, 2a04:4e42:36::175
正在连接 bootstrap.pypa.io (bootstrap.pypa.io)|151.101.108.175|:443… 已连接。
已发出 HTTP 请求,正在等待回应… 200 OK
长度: (1.8M) [text/x-python]
正在保存至: “get-pip.py”
100%[======================================================================================================================>] 1,908,223 4.20MB/s 用时 0.4s
2022-06-02 15:50:49 (4.20 MB/s) – 已保存 “get-pip.py” [/])
[root@localhost ~]# python3 get-pip.py
Collecting pip<21.0
Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 676 kB/s
Collecting wheel
Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, pip
Attempting uninstall: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Successfully installed pip-20.3.4 wheel-0.37.1
[root@localhost ~]# pip install pywinrm>=0.3.0
-bash: /usr/bin/pip: 没有那个文件或目录
[root@localhost ~]# pip -V
-bash: /usr/bin/pip: 没有那个文件或目录
解决方案,执行以下命令:
[root@localhost ~]# hash -r
[root@localhost ~]# pip -V
pip 20.3.4 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
[root@localhost ~]# pip install pywinrm>=0.3.0
WARNING: You are using pip version 20.3.4; however, version 21.3.1 is available.
You should consider upgrading via the ‘/usr/bin/python3 -m pip install –upgrade pip’ command.
[root@localhost ~]# /usr/bin/python3 -m pip install –upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.6/site-packages (20.3.4)
Collecting pip
Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
|████████████████████████████████| 1.7 MB 675 kB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.3.4
Uninstalling pip-20.3.4:
Successfully uninstalled pip-20.3.4
Successfully installed pip-21.3.1
安装python3
安装依赖
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel gcc gcc-c++
下载python3
wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
tar -zxvf Python-3.8.3.tgz
编译安装
mkdir /usr/local/python3
cd Python-3.8.3
https://blog.csdn.net/weixin_/article/details/configure –prefix=/usr/local/python3
make && make install
修改python指向,python2指向python3
rm -rf /usr/bin/python
ln -s /usr/local/python3/bin/python3 /usr/bin/python
修改系统默认pip指向
rm -rf /usr/bin/pip Navicat for Premium 9.0.2激活
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip
修复yum
系统指向的python3会导致yum不能正常使用,需要修改为默认python2
vi /usr/bin/yum
把 #! /usr/bin/python 修改为 #! /usr/bin/python2
vi /usr/libexec/urlgrabber-ext-down
把 #! /usr/bin/python 修改为 #! /usr/bin/python2
vi /usr/bin/yum-config-manager
#!/usr/bin/python 改为 #!/usr/bin/python2
没有的不用修改
今天的文章
Navicat for Premium 9.0.2激活(centos删除多余内核+安装mysql8.0+数据库连接失败+python3+pip)分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/116860.html