mysql5.5.20 源代码安装!

INSTALL-SOURCE里面有步骤
# Preconfiguration setup
shell> groupadd mysql
shell> useradd -r -g mysql mysql
# Beginning of source-build specific instructions
shell> tar zxvf mysql-VERSION.tar.gz
shell> cd mysql-VERSION
shell> cmake .
shell> make
shell> make install
# End of source-build specific instructions
# Postinstallation setup
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server
F.A.Q
 

 
  1. cmake .可能会报错! 
  2. - Could NOT find Curses  (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH) 
  3. CMake Error at cmake/readline.cmake:83 (MESSAGE): 
  4.   Curses library not found.  Please install appropriate package, 
  5.  
  6.       remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel. 
  7. Call Stack (most recent call first): 
  8.   cmake/readline.cmake:127 (FIND_CURSES) 
  9.   cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT) 
  10. 按照提示,remove掉CMakeCache.txt 然后 yum install ncurses-devel 这个包!接下来按照INSTALL-SOURCE的流程走! 
  11. 另外启动的时候可能会有报错 
  12. 120214 13:30:53 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 
  13. /usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist 
  14. 120214 13:30:53 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 
  15. 提示说要运行mysql_upgrade 创建mysql.plugin 表, 
  16. 我的做法是这样的! 
  17. ./scripts/mysql_install_db --user=mysql 
  18. 初始化下数据库 
  19. 然后启动就没问题了!