因为要恢复一个多年前的项目备份,需要一个古老的运行环境。
参考:https://amon.org/php5217
参考:https://amon.org/mysql
参考:https://amon.org/mysql-compile
下载源码编译安装MySQL:
下载:https://dev.mysql.com/downloads/mysql/5.7.html#downloads
wget -c http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz && tar -zxvf mysql-5.1.73.tar.gz && cd mysql-5.1.73 ./configure --prefix=/usr/local/mysql --enable-local-infile make && make install
相关路径:
/etc/my.cnf
/tmp/mysql.sock
复制配置文件:
cp support-files/my-medium.cnf /etc/my.cnf
创建用户&用户组:
groupadd mysql && useradd -g mysql mysql
设置mysql权限:
cd /usr/local/mysql chown -R mysql . chgrp -R mysql .
新建mysql允许的表:
/usr/local/mysql/bin/mysql_install_db --user=mysql chown -R mysql var
设置mysql开机自启动:
cp /root/mysql-5.1.73/support-files/mysql.server /etc/rc.d/init.d/mysql chmod +x /etc/rc.d/init.d/mysql chkconfig --add mysql
测试并运行mysql:
/usr/local/mysql/bin/mysqld_safe --user=mysql & service mysql start service mysql stop
设置mysql管理员密码
/usr/local/mysql/bin/mysqladmin -u root password YOURPASSWORD
使用用户登录mysql
/usr/local/mysql/bin/mysql -u root -p
更改密码:
use mysql; update user set password=password("NewPass") where user="root"; flush privileges;