root@www:/db/mysql-4.0.26# apt-get install curses
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
Reading state information... 完成
E: 无法找到软件包 curses
看来没搞对,那这样再试:
root@www:/db/mysql-4.0.26# apt-get install libncurses5-dev
可以下载了,然后再configure就可以了,继续
root@www:/db/mysql-4.0.26# make
root@www:/db/mysql-4.0.26# make install
root@www:/db/mysql-4.0.26# cd ..
root@www:/db# cd mysql4
确认一下my.cnf的内容,
root@www:/db/mysql4# more share/mysql/my-small.cnf
因为Ubuntu6.10的mysql5的my.cnf文件位置不是通常的/etc/,而是/etc/mysql,所以可以放心的复制mysql4的my.cnf到/etc/,且因为mysql4只是
为了兼容原有的一个站点,访问量也小,所以用small配置就行了
root@www:/db/mysql4# cp share/mysql/my-small.cnf /etc/my.cnf
初始化数据库
root@www:/db/mysql4# bin/mysql_install_db --user=mysql
按mysql手册说法,应该再
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
但由于我当时指定了sock为.下,所以应该改成mysql,不注意就打成了
root@www:/db/mysql4# chown -R mysql .
其实本应该
chown mysql .
所以干脆重作,
root@www:/db/mysql4# chown -R root .
root@www:/db/mysql4# chown -R mysql var
root@www:/db/mysql4# chgrp -R mysql
root@www:/db/mysql4# chown mysql .
启动服务器
root@www:/db/mysql4# bin/mysqld_safe --user=mysql &
客户端连接一下
root@www:/db/mysql4# 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>
看来一切良好,关闭服务器
root@www:/db/mysql4# 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的客户端
