Upgrading MySQL to 5.5.22 in Ubuntu 12.04 causes the original MySQL loading to fail.
Solution:
1. completely uninstall the original MySQL
- Sudo apt-get remove mysql-server
- Sudo apt-get autoremove -- purge mysql-server
- Sudo apt-get remove mysql-common (this step is important)
- Dpkg-l | grep ^ rc | awk'{Print $2 }'| Sudo xargs dpkg-P
2. reinstall mysql (restart before installation)
Sudo apt-get install mysql-server
Sudo apt-get install mysql-workbench (the original client cannot be used)
Run the following command to check whether the installation is successful:
Sudo netstat-tap | grep mysql
3. mysql2 in the original gem needs to be re-compiled and installed
- Gem uninstall mysql2
- Gem install mysql2
4. the following error may occur during mysql2 installation:
- Gem: Installer: ExtensionBuildError: ERROR: Failed to build gem native extension.
- /Homexxx/. rbenv/versions/1.9.3-p125/bin/ruby extconf. rb
- CheckingForRb_thread_blocking_region ()... yes
- CheckingForRb_wait_for_single_fd ()... yes
- CheckingForMysql_query ()In-Lmysqlclient... no
- CheckingForMain ()In-Lm... yes
- CheckingForMysql_query ()In-Lmysqlclient... no
- CheckingForMain ()In-Lz... yes
- CheckingForMysql_query ()In-Lmysqlclient... no
- CheckingForMain ()In-Lsocket... no
- CheckingForMysql_query ()In-Lmysqlclient... no
- CheckingForMain ()In-Lnsl... yes
- CheckingForMysql_query ()In-Lmysqlclient... no
- CheckingForMain ()In-Lmygcc... no
- CheckingForMysql_query ()In-Lmysqlclient... no
- * ** Extconf. rb failed ***
- CocouldNotCreate Makefile due to some reason, probably lack
- Necessary librariesAnd/OrHeaders. Check the mkmf. log fileForMore
- Details. You may need configuration options.
Solution:
- Sudo apt-get install libmysql-ruby
- Sudo apt-get install libmysqlclient-dev
- Gem install mysql
For more information about Ubuntu, see Ubuntu special page http://www.bkjia.com/topicnews.aspx? Tid = 2