登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

herb

喜欢写博,喜欢安静,喜欢挑战!

 
 
 

日志

 
 

编译安装mysql及问题汇总  

2011-03-15 14:15:49|  分类: Mysql |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

编译安装mysql

groupadd mysql
useradd -g mysql mysql
MYSQLFILE="mysql-5.1.24-rc.tar.gz"
tar -zvxf $MYSQLFILE
cd mysql-5.1.24-rc
'./configure' \
'--prefix=/usr/local/mysql' \
'--with-charset=utf8' \
'--with-extra-charsets=latin1,gbk,gb2312,ascii,big5'
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
bin/mysql_install_db --user=mysql

chown -R root .

chown -R mysql var          

#到此处已安装完成。可启动mysql:/usr/local/mysql/bin/mysqld_safe --user=mysql &

#关闭mysql:/usr/local/mysql/bin/mysqladmin -p shutdown 

#  如下为添加mysql至服务

cp mysql-5.1.24-rc/support-files/mysql.server /etc/rc.d/init.d/mysqld

chmod 775 /etc/rc.d/init.d/mysqld
chkconfig –add mysqld
然后启动即可--service mysqld start   自启动:chkconfig --level 35 mysqld on
添加至环境变量:
vi /etc/profile
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/mysql/lib
export LD_LIBRARY_PATH
PATH=$PATH:.:/usr/local/mysql/bin
export PATH

编译安装出现如下错误

checking whether make sets $(MAKE)... yes
checking "character sets"... default: utf8, collation: utf8_general_ci; compiled in: utf8 latin1 utf8 latin1 gbk gb2312 ascii big5
checking whether to compile national Unicode collations... yes
checking for doxygen... no
checking for pdflatex... no
checking for makeindex... no
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gawk... (cached) gawk
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.The solution is simple, run one of the following commands to install a C compiler:
未安装c语言编译环境!
解决办法:
CentOS: yum -y install gcc
Fedora: up2date -i gcc


./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=latin1,gbk,gb2312,ascii,big5


make[1]: Entering directory `/usr/local/software/tools/mysql-5.1.52/mysys'
source='my_new.cc' object='my_new.o' libtool=no
DEPDIR=.deps depmode=none /bin/sh ../depcomp
g++ -DDEFAULT_BASEDIR="/usr/local/mysql" -DMYSQL_DATADIR=""/usr/local/mysql/var"" -

DDEFAULT_CHARSET_HOME=""/usr/local/mysql"" -DSHAREDIR=""/usr/local/mysql/share/mysql"" -DDEFAULT_HOME_ENV=MYSQL_HOME -

DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR=""/usr/local/mysql/etc"" -DHAVE_CONFIG_H -I. -I../include

-I../include -I../include -I.    -O    -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o my_new.cc
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] Error 127
make[1]: Leaving directory `/usr/local/software/tools/mysql-5.1.52/mysys'
make: *** [all-recursive] Error 1

../depcomp: line 571: exec: g++: not found   提示这个是缺少:gcc-c++-3.4.6-3.i386.rpm

 yum -y install  gcc-c


3../include/my_global.h:909: error: redeclaration of C++ built-in type `bool'

make[2]: *** [my_new.o] Error 1

make[2]: Leaving directory `/home/tools/mysql-5.0.22/mysys'

make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/mysql-5.1' make: *** [all] Error 2

yum -y install ncurses-devel

根据提示安装累得半死,后来直接找到依赖包全部安装就好了!
      

依赖的开发包安装

 yum -y install gcc glib gcc-c++ esound-devel ncurses-devel





  评论这张
 
阅读(853)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018