MySQL :: Download MySQL Community Server (Archived Versions)
https://docs.oracle.com/cd/E19078-01/mysql/mysql-refman-5.1/installing.html#quick-install
比如本次我们要用的Linux操作系统是 ubuntu 9.04 (jaunty)
https://github.com/iComputer7/ancient-ubuntu-docker
docker run -it icomputer7/ancient-ubuntu-docker:jaunty /bin/bash
apt-get update
非常重要的library!
apt-get install g++ gcc build-essential cmake make libncurses5-dev
exit
docker start (id)
docker exec -it (id) /bin/bash
docker cp mysql-5.0.96.tar.gz (id):/home
groupadd mysql
useradd -g mysql mysql
./configure --prefix=/usr/local/mysql
看到一下信息表示安装成功了!
Thank you for choosing MySQL!
Remember to check the platform specific part of the reference manual
for hints about installing MySQL on your platform.
Also have a look at the files in the Docs directory.
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charset=all --enable-thread-safe-client --enable-local-infile
make && make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql //进入mysql目录
bin/mysql_install_db --user=mysql //初始化数据库
chown -R root . //设置安装根目录权限
chown -R mysql /usr/local/mysql/var //设置数据目录的权限
bin/mysqld_safe --user=mysql & //以安全方式启动mysql,后面加一个&表示后台运行
bin/mysqladmin -uroot password 123456 #在mysql首次正常启动情况下,更改root用户登录密码
bin/mysql -uroot -p #输入此命令后,按回车会显示让你输入root密码
mysql> show databases; #show一下你所有的数据库。
mysql> quit; #退出mysql
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
//这样就可以通过/etc/init.d/mysqld start|stop|restart来重启mysqll
echo export PATH=$PATH:/usr/local/mysql/bin >> /etc/profile //配置mysql环境变量
source /etc/profile //要让刚才的修改马上生效,需要执行此代码