rpm -qa | grep mysql
rpm -e --nodeps mysql-libs-xxx
find / -name mysql
whereis mysql
cd /user/local/src/
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz
tar -zxvf mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz
mkdir -p /usr/local/mysql/data
mv mysql-5.7.37-linux-glibc2.12-x86_64/* /usr/local/mysql/
groupadd mysql
useradd -r -g mysql mysql
chown -R mysql:mysql /usr/local/mysql
chmod +775 /usr/local/mysql
sh /usr/local/mysql/bin/mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
/usr/local/mysql/support-files/mysql.server start
ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
service mysql restart
mysql -u root -p 刚刚的保留的长期明码
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
use mysql;
update user set user.Host='%' where user.User='root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;
复制 mysql 服务并赋予执行权限
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
增加 mysql 零碎服务
chkconfig --add mysqld