-
Unzip mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz, change its name to mysql, and put it in the /usr/local directory
-
Add the mysql user and group, then install mysql and start it. The initial password is saved by /root/.mysql_secret. The command used is as follows:
groupadd mysql
useradd mysql -g mysql
cd /usr/local/mysql/bin
yum install libaio
./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data
cd /usr/local/mysql/support-files
./mysql.server start
-
Use the initial password to log in to mysql, change the password, and set root to connect remotely
The command is as follows:
cat /root/.mysql_secret
cd /usr/local/mysql/bin
./mysql -u root -p
set password =password('new password');
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "1新密码";
flush privileges;
May not be able to connect remotely, try to close the firewall, the command is as follows:
service iptables stop
setenforce 0
-
sr sets mysql to start automatically at boot and adds a soft connection
The command is as follows:
cd /usr/local/mysql/support-files/
cp mysql.server /etc/init.d
cd /etc/init.d
mv mysql.server mysqld
cd /usr/bin
ln -s /usr/local/mysql/bin/mysql mysql
Centos6.5 install mysql-5.7
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=326850080&siteId=291194637
Recommended
Ranking