Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2113830
  • 博文数量: 82
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 880
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-14 00:01
文章分类

全部博文(82)

文章存档

2014年(1)

2011年(1)

2009年(8)

2008年(11)

2007年(13)

2006年(26)

2005年(22)

我的朋友

分类: Mysql/postgreSQL

2007-09-02 00:34:16

解压mysql4.0.26
# tar zxvf mysql-4.0.26.tar.gz
备份mysql5的数据目录
# tar czvf mysql5.data.tar.gz mysql5
编译
# cd mysql-4.0.26
# ./configure --prefix=/db/mysql4
最后提示:
checking "LinuxThreads"... "Not found"
configure: error: This is a linux system and Linuxthreads was not
found. On linux Linuxthreads should be used.  Please install Linuxthreads
(or a new glibc) and try again.  See the Installation chapter in the
Reference Manual for more information.
怎么会没有Linuxthreads?查看
# gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --
with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
也许是gcc版本太新的原因?上网一查,是因为新内核使用了NTPL这种先进的线程处理方式,于是就这样:
# cp /usr/include/pthread.h /usr/include/pthread.h.bak
# echo '/* Linuxthreads */' >> /usr/include/pthread.h
然后编译,并且加了点参数
# ./configure --prefix=/db/mysql4 --with-unix-socket-path=/db/mysql4/mysql.sock --with-tcp-port=3304
--with-low-memory
在检测Linuxthreads地方显示为Found,但后来还是停下了,
checking whether signal handlers are of type void... yes
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for termcap functions library... configure: error: No curses/termcap li
brary found
看来要装ncurses,
# apt-get install ncurses
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
Reading state information... 完成
现在没有可用的软件包 ncurses,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到
E: 软件包 ncurses 还没有可供安装的候选者
# apt-get install curses
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
Reading state information... 完成
E: 无法找到软件包 curses
看来没搞对,那这样再试:
# apt-get install libncurses5-dev
可以下载了,然后再configure就可以了,继续
# make
# make install
# cd ..
# cd mysql4
确认一下my.cnf的内容,
# more share/mysql/my-small.cnf
因为ubuntu6.10的mysql5的my.cnf文件位置不是通常的/etc/,而是/etc/mysql,所以可以放心的复制mysql4的my.cnf到/etc/,且因为mysql4只是
为了兼容原有的一个站点,访问量也小,所以用small配置就行了
# cp share/mysql/my-small.cnf /etc/my.cnf
初始化数据库
# bin/mysql_install_db --user=mysql
按mysql手册说法,应该再
shell> chown -R root  .
shell> chown -R mysql var
shell> chgrp -R mysql .
但由于我当时指定了sock为.下,所以应该改成mysql,不注意就打成了
# chown -R mysql .
其实本应该
chown mysql .
所以干脆重作,
# chown -R root .
# chown -R mysql var
# chgrp -R mysql
# chown mysql .
启动服务器
# bin/mysqld_safe --user=mysql &
客户端连接一下
# bin/mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.26
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
看来一切良好,关闭服务器
# bin/mysqladmin shutdown
然后修改/etc/rc.local,在exit 0之前加入/db/mysql4/share/mysql/mysql.server start,这样就可以开机自动启动了.
剩下的事就是设定root密码,建库等了.要导入原来的备份数据库,可以这样,
/db/mysql4/bin/mysql -u username -p database < data.sql
记得执行mysql要带路径,否则是调用的系统自带的mysql5的客户端
 
 
 

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