1.下载SQLite源码包安装:
wget http://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
tar zxvf sqlite-autoconf-3280000.tar.gz -C /usr/src/
cd /usr/src/sqlite-autoconf-3280000/
./configure --prefix=/usr/local/sqlite
make && make install
2.替换旧版SQLite:
mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
cd /usr/local/sqlite/bin/
ln -s sqlite3 /usr/bin/sqlite3
3.修改共享库:
vim /etc/profile
export LD_LIBRARY_PATH="/usr/local/sqlite/lib"
4.让配置生效:
source /etc/profile
5.确认SQLite版本:
sqlite3 --version
6.在Python中确认SQLite版本:
python3 -c "import sqlite3; print(sqlite3.sqlite_version)"
完成以上步骤后,即可重新启动Django应用程序。