mysql5.6.35-glibc installation
Official website download: mysql official website
Create user mysql
useradd mysql -r -s /bin/false
Unzip the installation package
tar -zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
Modify the mysql file name
mv mysql-5.6.35-linux-glibc2.5-x86_64 mysql
Change mysql file permissions
chown -R mysql.mysql /usr/local/mysql
Confirm that there is no my.cnf file in the system
rm -rf /etc/my.cnf
Initialize mysql
//mysql目录下执行
scripts/mysql_install_db --user=mysql
If there is an error
FATAL ERROR: please install the following Perl modules before executing scripts/mysql_install_db: Data::Dumper
Solution: install the autoconf library
yum -y install autoconf
Copy the script to /etc/init.d and start
cp support-files/mysql.server /etc/init.d/mysql5.6.35
service mysql5.6.35 start
Set the root password according to the above log prompt
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h izbp15qjp71zgmecy3ddzfz password 'new-password'
./bin/mysql_secure_installation
Add mysql environment variable
vim /etc/profile
source /etc/profile
Log in to the client
mysql -u root -p