- 起因
最近为公司写python程序需要打包为exe文件夹,因此创建Venv环境以免生成的exe文件过大。
- 解决办法
- 进入需要生成Venv环境的文件夹
- 输入如下命令:“python -m venv myvenv”
- 进入生成的文件夹中的Scripts文件夹
- 输入activate激活虚拟环境
- 输入deactivate退出虚拟环境
最近为公司写python程序需要打包为exe文件夹,因此创建Venv环境以免生成的exe文件过大。
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
wget http://repo.mysql.com/mysql80-community-release-el7.rpm
rpm -ivh mysql80-community-release-el7.rpm
cd /etc/yum.repo
vi mysql-community.repo
gpgcheck=0
yum install mysql-server
systemctl start mysqld
systemctl status mysqld
systemctl enable mysqld
mysqld --initialize
#获取MySQL临时密码
grep 'temporary password' /var/log/mysqld.log
#修改MySQL密码<
alter user 'root'@'localhost' identified by 'P@ssw0rd';
use mysql;
#修改root账户权限
update user set host = '%' where user = 'root';
#刷新权限<br>flush privileges;
在CentOS8中使用yum时出现错误,问题如下:
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
在2022年1月31日,CentOS团队终于从官方镜像中移除CentOS 8的所有包。
CentOS 8已于2021年12月31日寿终正寝,但软件包仍在官方镜像上保留了一段时间。现在他们被转移到https://vault.centos.org
1.备份源文件
cd /etc/yum.repos.d/ && mkdir backup && mv *repo backup/
2.下载阿里源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
3.更新源文件内地址
sed -i -e "s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum.repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
4.生成缓存
yum clean all && yum makecache
近期去面试,被问到对于MySQL主从复制模式的原理,回答不甚理想,因此留下此贴进行记录。