更新源
cat /etc/apt/sources.list
deb http://archive.debian.org/debian lenny contrib main non-free执行apt-get update时若报如下错误:
Reading package lists... Done
W: There is no public key available for the following key IDs:
4D270D06F42584E6
W: You may want to run apt-get update to correct these problems
解决方法如下:
apt-get install debian-keyring debian-archive-keyring
apt-key update
2#安装mysql所需的包
apt-get install -y build-essential gcc g++ make
3#安装cmake,mysql5.6需要cmake的版本至少2.8
wget http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz
tar zxvf cmake-2.8.11.2.tar.gz
cd cmake-2.8.11.2
./bootstrap [root@zhu3 ~]
make && make install
4.编译安装mysql
cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1
若安装碰到如下错误
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:85 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:128 (FIND_CURSES)
cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:325 (MYSQL_CHECK_EDITLINE)
解决方法如下:
apt-get -y install libncurses5-dev
最后:
make && make install#自此编译安装mysql完成,接下来是mysql的善后工作。