标签 镜像 下的文章

Ubuntu 18.04更换国内镜像源提高安装更新速度

Ubuntu18.04默认安装完以后镜像是官方的,国内更新速度太慢,更新为阿里云或中科大等其他国内源,速度会明显提高,操作方法如下:
备份原文件:

cp /etc/apt/sources.list /etc/apt/sources.list_bak

将/etc/apt/sources.list文件内容替换为如下:(任意其一即可)
阿里云镜像源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

网易镜像源

deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

清华镜像源

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

中科大镜像源

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

更新系统及软件

sudo apt-get update

sudo apt-get upgrade

后面在安装软件速度就很快了~.

使用国内镜像源 提高pip安装更新速度

不论是使用 pip,还是 Pipenv、Poetry等工具,安装 Python 包的时候会默认从官方的 PyPI 源下载文件,速度比较慢。国内的一些公司和机构提供了 PyPI 镜像源(mirror source),你可以设置让这些工具从国内的镜像源安装 Python 包,以便提高下载速度。

官方 PyPI 源的 URL 为 https://pypi.org/simple (旧的 URL 为 https://pypi.python.org/simple

pip更换临时设置可以通过 -i 选项:

pip install -i https://mirrors.aliyun.com/pypi/simple/ flask

永久更换:
Windows系统:
首先在window的文件夹窗口输入 : %APPDATA%



---阅读剩余部分---

AWS镜像AMI制作

先在本地安装Oracle VM VirtualBox,安装好虚拟机(调整优化系统各个参数)此处不再赘述,IP设置为自动获取,最后关机导出,格式为“开放式虚拟化格式 1.0”,如下图,导出完以后上传到S3存储上;

---阅读剩余部分---

Docker下面安装MySQL5.7.21

安装MySQL5.7.21镜像

docker pull mysql:5.7.21

查看安装的镜像docker images

[root@cops163 ~]# docker images | grep mysql
docker.io/mysql         5.7.21              5195076672a7        6 days ago          371 MB

创建数据目录

mkdir /data/mysql_data

创建配置文件目录

mkdir /data/conf

创建并运行镜像

docker run -p 3306:3306 --name mysql001 --restart=always -v /data/conf:/etc/my.cnf.d -v /data/mysql_data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7.21 --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci

参数说明如下:

-p 3306:3306  #将容器的3306端口映射到主机的3306端口
--name mysql001  #容器的名字为mysql001
--restart=always  #在宿主机重启后或者Docker服务重启后自动启动容器,
no #不重启(不带restart参数时,默认不重启)
on-failure  #退出状态非0时重启
always  #始终重启
-v /data/conf:/etc/my.cnf.d  #将/data/conf目录映射到/etc/my.cnf.d下面 
-v /data/mysql_data:/var/lib/mysql  #将/data/mysql目录映射到/var/lib/mysql下面
-e MYSQL_ROOT_PASSWORD=123456 #设置root初始密码为123456
 -d mysql:5.7.21  #后台运行容器,并返回容器ID
--character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci   #设置编码为utf8mb4

进入Docker MySQL控制台

docker exec -it mysql001 mysql -uroot -p
mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using  EditLine wrapper

Connection id:          2
Current database:       langold_enrolment
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.7.21 MySQL Community Server (GPL)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /var/run/mysqld/mysqld.sock
Uptime:                 47 min 16 sec

Threads: 2  Questions: 1785612  Slow queries: 0  Opens: 246  Flush tables: 1  Open tables: 135  Queries per second avg: 629.623
--------------
mysql> 

查看docker容器的log

docker logs -f mysql001

导入SQL文件到MySQL中

docker exec -i mysql001 mysql -uroot -p123456 langold_enrolment < /tmp/langold_enrolment.sql

导出SQL文件

docker exec -it mysql001 mysqldump -uroot -p123456 aaa > /tmp/aaa.sql

更多参考Docker官方文档:
https://hub.docker.com/r/mysql/mysql-server/

win10下快速安装MySQL5.7.18

做一些小项目要到了MySQL装在本地,开发调试起来比较方便,快速安装:
1、下载安装包、安装
这里是直接搜狐镜像上下载的:
mysql-5.7.18-winx64下载地址: http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.18-winx64.msi
选择自定义安装,安装路径为C:mysql57(根据实际情况选择) 一路next,即可完成。
2、配置服务、初始化

把C:\mysql57\bin加入到本地Path里面,方便以后使用,
创建C:\mysql57\data目录
创建C:\mysql57\my.cnf文件加入以下内容:(根据实际情况修改)





---阅读剩余部分---

最新

分类

归档

评论

  • 安安: 都是af
  • Liang: 嗯,有点不通顺·
  • 王庭威: “MySQL互为主从...
  • Liang: 贴下编译参数和步骤,...
  • shao3911: 您好,为什么我在编译...
  • aliang: 先看是yum安装还是...
  • aliang: 将原来的nginx安...
  • yen: 3、如果要回滚的话,...
  • yen: 刚好需要升级ngin...
  • 文雨: 一些新的method...

其它