Python代码MQTT配合mysql使用报错AttributeError: 'NoneType' object has no attribute 'read'

Python代码MQTT配合mysql使用报错AttributeError: 'NoneType' object has no attribute 'read'

MQTT配合mysql使用报错AttributeError: 'NoneType' object has no attribute 'read'猜测是多线程的原因,多个线程共享了一个数据库连接解决方法执行sql时加上互斥锁import threading lock = threading.Lock() lock.acquire() cursor.execute(command,data) lock.release()也可创建两个数据库连接解决参考:https://blog.csdn.net/qq_29666899/article/details/82990599

Python 2021-09-26 PM 3℃ 0条
Centos7安装docker

Centos7安装docker

更新yumyum update安装依赖包yum install -y yum-utils device-mapper-persistent-data lvm2设置yum源yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo安装dockeryum install docker-ce启动并加入开机systemctl start docker systemctl enable docker查看已安装版本docker version安装docker-composecurl -L ...

Linux,工具,部署 2021-09-15 PM 33℃ 3条
解决Linux环境下Python画图Matplotlib不显示中文字体

解决Linux环境下Python画图Matplotlib不显示中文字体

https://blog.csdn.net/qq_36767053/article/details/102549523

Python,Linux,工具 2021-08-27 PM 41℃ 0条
mondorescue备份centos镜像报错254解决方法

mondorescue备份centos镜像报错254解决方法

报错信息# /var/log/mondoarchive.log /boot/vmlinuz-2.6.18-128.el5 Calling MINDI to create boot+data disks Your boot loader is GRUB and it boots from /dev/sda Waiting for external binary to start Mindi failed to create your boot+data disks. Fatal error... Failed to generate boot+data disks ---FATALERRO...

Linux,bug记录 2021-08-25 PM 67℃ 0条
ngrok后台运行并开机启动

ngrok后台运行并开机启动

ngrok使用nohup不能正常后台运行,需要使用supervisor库http://www.jerrymei.cn/supervisor-ngrok/https://zhuanlan.zhihu.com/p/79801019

Linux 2021-08-16 AM 51℃ 0条
win10安装docker

win10安装docker

https://www.jianshu.com/p/ae728f8d7636

2021-08-12 PM 46℃ 0条
django使用redis

django使用redis

https://blog.csdn.net/m0_37886429/article/details/82556935

django,Python 2021-08-10 PM 53℃ 0条
docker-compose安装

docker-compose安装

curl -L https://get.daocloud.io/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose

Linux 2021-08-09 PM 57℃ 0条