Chinaunix首页 | 论坛 | 博客
  • 博客访问: 316609
  • 博文数量: 40
  • 博客积分: 892
  • 博客等级: 准尉
  • 技术积分: 445
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-25 10:20
文章存档

2011年(40)

分类: Mysql/postgreSQL

2011-03-30 21:06:19

上mysql的网站下载mysql最新版本
选择Source Code
下载mysql-5.5.10.tar.gz
#mkdir -p /usr/local/mysql
#cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/
会出现以下错误:
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:216 (MYSQL_USE_BUNDLED_LIBEDIT)
  CMakeLists.txt:250 (MYSQL_CHECK_READLINE)
解决办法:
可能是缺少libncurses5-dev包
我们安装ncurses包
http://ftp.gnu.org/pub/gnu/ncurses/
下载ncurses
我们下载最新的ncurses-5.8.tar.gz
#mkdir -p /usr/local/ncurses-5.8
#./configure --prefix=/usr/local/ncurses-5.8/
#make
#make install
#cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ -DMYSQL_DATADIR=/usr/local/mysql/data -DCURSES_INCLUDE_PATH=/usr/local/ncurses-5.8/include/ -DCURSES_LIBRARY=/usr/local/ncurses-5.8/lib/libncurses.a
#make
#make install

# groupadd mysql
# usradd -g mysql mysql
# chown -R mysql:mysql /usr/local/mysql
# cp support-files/my-medium.cnf /etc/my.cnf

安装完后启动mysql

#/usr/local/mysql/scripts/mysql_install_db --user=root --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ &
#/usr/local/mysql/bin/mysqld_safe --user=root
#cd /usr/local/mysql/bin/mysql -u root
即可启动mysql,出现一下标志:
>mysql
在这里一定要使用root用户
不然会出现如下错误:
mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'.
101020 10:32:11 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
101020 10:32:11 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended
在/usr/local/mysql/data/localhost.localdomain.err中提示
101020 10:32:11 [ERROR] MYSQL_BIN_LOG::open_purge_index_file failed to open     register  file.
101020 10:32:11 [ERROR] MYSQL_BIN_LOG::open_index_file failed to sync the in    dex file.
101020 10:32:11 [ERROR] Aborting
这里是文件访问权限的问题


                                                                                                                                                                                                                                                     huguohu
                                                                                   
                                                                                 

阅读(3837) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~