MySQL编译安装_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 1918 | 回复: 0   主题: MySQL编译安装        下一篇 
napolenAx
注册用户
等级:少校
经验:802
发帖:118
精华:1
注册:2011-8-30
状态:离线
发送短消息息给napolenAx 加好友    发送短消息息给napolenAx 发消息
发表于: IP:您无权察看 2014-11-13 15:10:47 | [全部帖] [楼主帖] 楼主

在ubuntu-12.04.3-server-i386下编译安装MySQL5.6过程大致如下:

cd ~
sudo su -
wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.14.tar.gz &
apt-get install -y bzr bison libncurses5-dev gcc g++ cmake make
wait && fg
tar xf mysql-5.6.14.tar.gz
groupadd mysql
useradd -g mysql mysql
cd mysql-5.6.14/
#以下两种方式任选其一
sh BUILD/autorun.sh
./configure --prefix=/usr/local/mysql/ --localstatedir=/data/mysqldata/data --enable-assembler --without-isam --with-unix-socket-path=/data/mysqldata/data --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-plugins=partition,innobase --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=utf8,gbk --with-big-tables --without-debug
#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc-DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1-DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1-DEXTRA_CHARSETS=utf8,gbk -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci-DWITH_PARTITION_STORAGE_ENGINE=1
make && make install
chown -R mysql:mysql /usr/local/mysql/
cd /usr/local/mysql/
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/
cp support-files/my-default.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql
./bin/mysqld_safe &
#server mysql start
echo "export PATH=\$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile


1.若make出现类似错误:

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".
CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.


表明make未安装,执行:sudo apt-get install -y make

参见: Mysql 错误以及解决办法

2.如果make到63%左右出现错误:

make[2]: *** [storage/perfschema/unittest/pfs_connect_attr-t] Error 1
make[1]: *** [storage/perfschema/unittest/CMakeFiles/pfs_connect_attr-t.dir/all] Error 2


则:cmake去掉-DWITH_PARTITION_STORAGE_ENGINE=1参数重新编译

参见: 通用MYSQL5.5和5.6源码包安装

3.MySQL启动报错:

[ERROR] InnoDB: The system tablespace must be writable!
[ERROR] Plugin 'InnoDB' init function returned error.


则:rm -rf /usr/local/mysql/data/ib_logfile*

编译参数及安装过程: Linux源码安装mysql 5.6.12 (cmake编译)

4.其他错误: Ubuntu 12 下的Mysql 5.5的 cmake 源码编译安装

5.编译错误:configure: error: No curses/termcap library found

查找文件系统:find / -name libncursesw*

如果找到则重新编译并加上以下参数:

--with-named-curses-libs=/lib/i386-linux-gnu/libncursesw.so.5.9


或者安装libncurses5-dev包:

sudo apt-cache search libncurses5 && sudo apt-get install -y libncurses5-dev


参考:http://younglab.blog.51cto.com/416652/136495

http://www.blogjava.net/wady/articles/294097.html


6.make出现错误:collect2: ld returned 1 exit status

尝试如下解决方案:

sudo apt-get install -f
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install -f build-essential libncurses5-dev libncurses5


参考:What can't I install ncurses-dev in Ubuntu 12.10?、

Ubuntu 12.04 下安装ncurses-devel、mysql安装

--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论