Ubuntu安装mysql5.6.10

Ubuntu下继续安装PHP开发环境,到了安装mysql这一步,由于下的是mysql的最新版本mysql-5.6.10,而mysql貌似从5.5已经不用./configure来配置了,换成了cmake。

于是只能google。最后结合几篇文章与mysql官网的配置介绍Source-Configuration Options,搞定了这个配置。

Selection_019

文本如下:

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci \
> -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
> -DWITH_MYISAM_STORAGE_ENGINE=1 \
> -DWITH_INNOBASE_STORAGE_ENGINE=1 \
> -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
> -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
> -DWITH_MEMORY_STORAGE_ENGINE=1 \
> -DWITH_READLINE=1 \
> -DENABLED_LOCAL_INFILE=1 \
> -DMYSQL_DATADIR=/db/mysql/data \
> -DMYSQL_USER=mysql \
> -DMYSQL_TCP_PORT=3306

哦对了,有可能会要sudo。

然后出现了一个问题。

Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (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:126 (FIND_CURSES)
cmake/readline.cmake:193 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:325 (MYSQL_CHECK_READLINE)
— Configuring incomplete, errors occurred!

既然少ncurses包,那就安装一下。

sudo apt-get install libncurses5-dev

然后把当前目录下这个缓存文件删除

sudo rm CMakeCache.txt

终于配置通过。

然后编译源码,需要等待一段时间。

sudo make

Selection_020

然后安装

sudo make install

这个就比较快了。两下搞定。

接下来就是配置了。配置了几个小时,,具体我忘了。好复杂啊~真回忆不起来具体有哪些步骤了,反正是一直网上边搜边做。sigh~

 

 

Leave a Reply

Your email address will not be published.