• Tar XZF mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz -c /root/mysql/
  • Mysql – 5.7.23 – Linux – mv glibc2.12 x86_64 mysql — 5.7.23
  • Mysql – 5.7.23 mv/usr/local/mysql
  • cd /usr/local/mysql/
  • groupadd mysql
  • useradd -r -g mysql mysql
  • cat /etc/passwd
  • Mkdir -p /data/mysql
  • Chown mysql:mysql -r /data/mysql
  • Vim /etc/my.cnf
[client] # default character set=utf8 [client] # default character set=utf8 [mysqld] Basedir =/usr/local/mysql /usr/local/mysql /usr/local/mysql /usr/local/mysql MySQL 8+ does not require the following configuration: Datadir =/data/mysql # max_connections=20 # latin1 character set character-set-server= UTf8 # Default storage engine default-storage-engine=INNODB socket=/ TMP /mysql.sock log-error=/data/mysql/mysql.err pid-file=/data/mysql/mysql.pid # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 explicit_defaults_for_timestamp=trueCopy the code
  • cd /usr/local/mysql/bin/
  • ./mysqld –defaults-file=/etc/my.cnf –basedir=/usr/local/mysql/ –datadir=/data/mysql/ –user=mysql –initialize
  • Cat /data/mysql/mysql.err
  • cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
  • service mysql start
  • /etc/init.d/mysql
  • ps -ef|grep mysql
  • ./mysql -u root -p
  • SET the PASSWORD = PASSWORD (” root “); Did you write down the reset password? well
  • ALTER USER ‘root’ @ ‘localhost’ PASSWORD EXPIRE NEVER;
  • FLUSH PRIVILEGES; This is a refresh change.
  • Use mysql to access the mysql library
  • Update user set host = ‘%’ where user = ‘root’; Make root accessible to any host
  • FLUSH PRIVILEGES; # refresh
Download resources
Links:Pan.baidu.com/s/1tZ_A5Coh…
Extraction code: 8888