1. 程式人生 > >Error loading MySQLdb module: libmysqlclient_r.so.18: cannot open shared object file: No such file

Error loading MySQLdb module: libmysqlclient_r.so.18: cannot open shared object file: No such file

錯誤:
Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory

在這裡插入圖片描述
錯誤原因:
我們在伺服器上自己安裝了MySQL,而解除安裝了原有的MySQL,伺服器有就將/usr/lib64/mysql下的libmysqlclient.so.18刪除掉,所以我們在使用Hue整合管理MySQL是就會出現如上所示的錯誤!
解決方案:
步驟一:
將原生系統檔案(沒有自行安裝mysql的)中的/usr/lib64/mysql/libmysqlclient.so.18這個檔案SCP到正在作業系統指定的/usr/lib64/mysql庫檔案目錄中。
步驟二:
  設定/etc/ld.so.conf檔案,編輯該檔案,在檔案中加入libmysqlclient.so.18所在目錄,儲存退出。
需要注意的是,每次改動ld.so.conf之後需要執行ldconfig來確認重新整理。