Ubuntu 升級到12.04引起的MySQL錯誤

來源:互聯網
上載者:User

Ubuntu 12.04中將MySQL升級到5.5.22導致原先的MySQL載入失敗

解決方案:

1.完全卸載原先的MySQL

  1. sudo apt-get remove mysql-server   
  2. sudo apt-get autoremove --purge mysql-server   
  3. sudo apt-get remove mysql-common(這步比較重要)   
  4. dpkg -l | grep ^rc | awk '{print $2}' | sudo xargs dpkg -P  

2.重新安裝mysql(安裝前最好重啟)

sudo apt-get install mysql-server  
sudo apt-get install mysql-workbench(原先的client無法使用) 

可使用以下命令檢查是否安裝成功

sudo netstat -tap | grep mysql 

3.原先gem中的mysql2需要重新編譯安裝

  1. gem uninstall mysql2   
  2. gem install mysql2  

4.安裝mysql2時可能出現以下錯誤

  1. Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.   
  2.   
  3. /homexxx/.rbenv/versions/1.9.3-p125/bin/ruby extconf.rb    
  4. checking for rb_thread_blocking_region()... yes   
  5. checking for rb_wait_for_single_fd()... yes   
  6. checking for mysql_query() in -lmysqlclient... no   
  7. checking for main() in -lm... yes   
  8. checking for mysql_query() in -lmysqlclient... no   
  9. checking for main() in -lz... yes   
  10. checking for mysql_query() in -lmysqlclient... no   
  11. checking for main() in -lsocket... no   
  12. checking for mysql_query() in -lmysqlclient... no   
  13. checking for main() in -lnsl... yes   
  14. checking for mysql_query() in -lmysqlclient... no   
  15. checking for main() in -lmygcc... no   
  16. checking for mysql_query() in -lmysqlclient... no   
  17. *** extconf.rb failed ***   
  18. Could not create Makefile due to some reason, probably lack of   
  19. necessary libraries and/or headers.  Check the mkmf.log file for more   
  20. details.  You may need configuration options.  

解決方案:

  1. sudo apt-get install libmysql-ruby   
  2. sudo apt-get install libmysqlclient-dev   
  3. gem install mysql  

更多Ubuntu相關資訊見Ubuntu 專題頁面 http://www.bkjia.com/topicnews.aspx?tid=2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.