遇到问题
在 centos 7 上面运行 django服务器时出现:
原因是系统自带 sqlite3 版本太低,解决方法是升级就可以了。
1.到SQLite官网下载较新版本的SQLite
https://www.sqlite.org/download.html
将下载好的tar.gz通过rz命令上传到linux服务器。
2.解压文件
[[email protected] ~]$ tar zxvf sqlite-autoconf-3310100.tar.gz
3.编译
[[email protected] ~]$ cd sqlite-autoconf-3310100/
[[email protected] sqlite-autoconf-3310100]$ ./configure --prefix=/usr/local
[[email protected] sqlite-autoconf-3310100]$ make && make install
4.替换旧版本的SQLite
[[email protected] ~]$ mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
[[email protected] ~]$ ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3
[[email protected] ~]$ echo "/usr/local/lib" > /etc/ld.so.conf.d/sqlite3.conf
[[email protected] ~]$ ldconfig
[[email protected] ~]$ sqlite3 -version
5.进入到django项目文件夹重新执行django服务器
$ python3 ./manage.py runserver 0.0.0.0:8800
启动成功后,访问该url在终端会出现页面请求的消息。
6.本文参考引用资料
《centos 7 下升级自带sqlite3》
https://www.cnblogs.com/leffss/p/11555556.html