mysql-5.5.14安裝筆記

由於新的mysql-5.5和以前版本相比,有了很多更新和改進,今天抽時間安裝了一下新版的mysql。一下是安裝筆記。

下載相關軟件:

新版mysql:http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.14.tar.gz

cmake:http://www.cmake.org/cmake/resources/software.html

安裝環境RHEL5.4

1、安裝cmake

 

  1. #tar zxf cmake-2.8.5.tar.gz  
  2. #cd cmake-2.8.5  
  3. #./bootstrap  
  4. #make  
  5. #make install  

 

2、編譯安裝mysql-5.5.14

 

  1. useradd mysql  
  2. tar zxf mysql-5.5.14.tar.g  
  3. cd mysql-5.5.14  
  4. CFLAGS="-O3" CXX=gcc 
  5. CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" 
  6. cmake . -LH|more //CMake下查看MySQL的編譯配置  
  7. cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DEXTRA_CHARSETS=all 
  8. make  
  9. make install  
  10. chown -R mysql:mysql /usr/local/mysql  
  11. cp support-files/my-medium.cnf /etc/my.cnf  
  12. cd /usr/local/mysql/  
  13. ./scripts/mysql_install_db --user=mysql 
  14. /usr/local/mysql/bin/mysqld_safe --user=mysql &  
  15. /usr/local/mysql/bin/mysql  
  16. Welcome to the MySQL monitor.  Commands end with ; or \g.  
  17. Your MySQL connection id is 2  
  18. Server version: 5.5.14-log Source distribution  
  19.  
  20. Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.  
  21.  
  22. Oracle is a registered trademark of Oracle Corporation and/or its  
  23. affiliates. Other names may be trademarks of their respective  
  24. owners.  
  25.  
  26. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  27.  
  28. mysql> show databases;  
  29. +--------------------+  
  30. | Database           |  
  31. +--------------------+  
  32. | information_schema |  
  33. | mysql              |  
  34. | performance_schema |  
  35. | test               |  
  36. +--------------------+  
  37. 4 rows in set (0.01 sec  
  38.  
  39.  
  40.  
  41.   

參考文檔:http://www.orczhou.com/index.php/2011/06/compile-and-install-mysql-5-5-from-source/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章