2、后来使用国内镜像源,还是报错,无法安装。
pip3 install 库名 -i 镜像源地址
例如:pip3 install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple
镜像源地址
清华: https://pypi.tuna.tsinghua.edu.cn/simple
豆瓣: http://pypi.douban.com/simple/
阿里: http://mirrors.aliyun.com/pypi/simple/
3、经网上查询,需使用”--trusted-host pypi.tuna.tsinghua.edu.cn ",可安装成功。
即:pip install 库名 -i 镜像源地址 --trusted-host pypi.tuna.tsinghua.edu.cn
例如:pip3 install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
4、验证pymysql是否安装成功。
>>>import pymysql 不报错就行。
1 用主从模式 看文档,这个最简单,但是同步的话非常麻烦。
2 用专门的集群软件 mysql网站上有介绍,但是只支持linux
mysql> show master status
+-------------+----------+--------------+------------------+
| File | Position | Binlog_do_db | Binlog_ignore_db |
+-------------+----------+--------------+------------------+
| bin_log.003 | 73 | book,xtdb | |
+-------------+----------+--------------+------------------+
mysql> show slave status
+---------------+-------------+-------------+---------------+-------------+-----+---------------+-----------------+---------------------+------------+------------+--------------+
| Master_Host | Master_User | Master_Port | Connect_retry | Log_File | Pos | Slave_Running | Replicate_do_db | Replicate_ignore_db | Last_errno | Last_error | Skip_counter |
+---------------+-------------+-------------+---------------+-------------+-----+---------------+-----------------+---------------------+------------+------------+--------------+
| 192.168.0.101 | backup | 3306 | 60 | bin_log.003 | 73 | Yes | book,xtdb | | 0 | | 0 |
+---------------+-------------+-------------+---------------+-------------+-----+---------------+-----------------+---------------------+------------+------------+--------------+
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)