网通Linux vps下源码编译安装MySQL

  网通Linux vps下源码编译安装MySQL准备工作:
  
  新建用户和用户组
  
  groupaddmysql
  
  useradd-gmysqlmysql
  
  1:下载:
  
  bison-2.4.2.tar.bz2
  
  cmake-2.8.3.tar.gz
  
  make-3.82.tar.gz
  
  bzr-2.3b5.tar.gz
  
  -
  
  mysql-5.5.8.tar.gz
  
  2:解压安装前3个包
  
  tarzxvfcmake-2.8.3.tar.gz
  
  cdcmake-2.8.3
  
  ./configure
  
  make
  
  makeinstall
  
  tarzxvfmake-3.82.tar.gz
  
  cdmake-3.8.2
  
  ./configure
  
  make
  
  makeinstall
  
  tarjxvfbison-2.4.2.tar.bz2
  
  cdbison-2.4.2
  
  ./configure
  
  make
  
  makeinstall
  
  3:解压mysql-5.5.8.tar.gz
  
  tarzxvfmysql-5.5.8.tar.gz
  
  cdmysql-5.5.8
  
  cmake.\
  
  -DCMAKE_INSTALL_PREFIX=/mysql/mysqldir\
  
  -DMYSQL_DATADIR=/mysql/mysqldir/data\
  
  -DWITH_INNOBASE_STORAGE_ENGINE=1\
  
  -DMYSQL_TCP_PORT=3306\
  
  -DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock\
  
  -DMYSQL_USER=mysql\
  
  -DWITH_DEBUG=0
  
  报错(如无报错直接make&makeinstall即可):
  
  CMakeErroratcmake/readline.cmake:82(MESSAGE):
  
  Curseslibrarynotfound.Pleaseinstallappropriatepackage,
  
  removeCMakeCache.txtandreruncmake.OnDebian/Ubuntu,packagenameislibncurses5-dev,onRedHatandderivatesitisncurses-devel.
  
  CallStack(mostrecentcallfirst):
  
  cmake/readline.cmake:126(FIND_CURSES)
  
  cmake/readline.cmake:216(MYSQL_USE_BUNDLED_LIBEDIT)
  
  CMakeLists.txt:256(MYSQL_CHECK_READLINE)
  
  --Configuringincomplete,errorsoccurred!
  
  缺少包:ncurses-devel
  
  解决:
  
  到安装光盘或者网上DOWN相应的包
  
  安装:
  
  rpm-ivhncurses-devel*.rpm
  
  rm-fCMakeCache.txt
  
  cmake.\
  
  -DCMAKE_INSTALL_PREFIX=/mysql/mysqldir\
  
  -DMYSQL_DATADIR=/mysql/mysqldir/data\
  
  -DWITH_INNOBASE_STORAGE_ENGINE=1\
  
  -DMYSQL_TCP_PORT=3306\
  
  -DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock\
  
  -DMYSQL_USER=mysql\
  
  -DWITH_DEBUG=0
  
  make
  
  makeinstall
  
  完成后进入MYSQL安装目录
  
  cd/mysql/mysqldir
  
  cpsupport-files/my-huge.cnf/etc/my.cnf
  
  vi/etc/my.cnf
  
  将数据目录和套接字文件修改为实际值.
  
  修改权限
  
  chownmysql:mysql/etc/my.cnf
  
  chown-Rmysql:mysql/mysql/mysqldir
  
  切换用户进入安装目录
  
  su-mysql
  
  cd/mysql/mysqldir
  
  cpscripts/mysql_install_db.
  
  ./mysql_install_db
  
  启动MYSQL
  
  bin/mysqld_safe&
  
  OK
  
 

你可能感兴趣的:(网通vps)