This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13837|Reply: 0

[Source] The sad history of linux update mysql 8.0

[Copy link]
Posted on 1/10/2019 2:15:36 PM | | | |
This article is based on personal experience, including the whole process of MySQL 8.0 upgrade, as well as the problems encountered and solutions encountered in the middle.

Valuable documents referenced throughout the process are marked.

Welcome to collect, welcome to forward, but hope to indicate the sourceThe hyperlink login is visible.OriginalNot easy



First, download and install the required installation package, and choose according to your needs (here is rhel7.4, 64-bit as an example)

The hyperlink login is visible.



Unzip the tar package

Tar -zxvf mysql-8.0.4-0.1.rc.el7.x86_64.rpm-bundle.tar

Error

gzip: stdin: not in gzipformat

tar: Child returnedstatus 1

tar: Error is notrecoverable: exiting now


Workaround:

Remove the z parameter and use tar -xvf to decompress normally

Cause analysis:

1. The name of the compressed file has been artificially changed, for example: the original compression is not .gz, the suffix is artificially modified, then the suffix can be removed and then decompressed, such as: file FMIS2600DMP.tar.gz, remove the gz suffix, and then use tar -xvf to decompress

2. The -z parameter is actually a pressurization or decompression program that calls bz2, and removing this parameter can also avoid this problem
Installation of software packages

Just follow the following here, otherwise there will be a lot of package dependency problems. I won't give specific problems, I have encountered quite a lot

Put all the rpm packages in the same empty folder, except mysql-community-server-miniaml-*, because it will conflict with the server and client,




Then use the following command to install (I recommend installing all of them directly, there is no need to limit a lot as I gave the link below, because then there will be some conflict problems, just install all 9 rpm packages with yum, it is recommended to install with yum, do not use rpm commands, because yum will automatically detect and solve the conflicts and dependencies between the installation packages)

sudoyum install mysql-community-*

Installation Reference:https://dev.mysql.com/doc/refman ... stallation-rpm.html


Can’t connect to local MySQL serverthrough socket ‘/var/lib/mysql/mysql.sock




Resolution steps:

1 systemctl stop mysqld (stop service)

2 rm -fr /var/lib/mysql/* (delete all files under /var/lib/mysql)

3 rm /var/lock/subsys/mysqld (delete lock file)

4 killall mysqld (kill all mysqld processes)

5 systemctl start mysqld (Start the mysql service.) )

Reference links:https://www.cnblogs.com/okstill/p/5667138.html


Root user logs in to the database without a password

Access denied for user 'root'@'localhost' (using password: YES)

Method:

Skip the root temporary password and log in to the database to change the password

1. Close the MySQL service:

systemctl stop mysqld

2. Set the environment variable to skip permission checks

systemctlset-environment MYSQLD_OPTS="--skip-grant-tables"

3. Restart the MySQL service

systemctl start mysqld

4. Log in as root

mysql -u root

At this point, you can log in successfully




5. Set a root password

UPDATE mysql.userSET authentication_string= PASSWORD('Root@123') WHERE User = 'root';

After MySQL 5.6, the strength of passwords was strengthened with the release of validate_password plugins (which in some places seem to have existed before, but are now required). Support password strength requirements. , check the configuration requirements of each parameter of the validate_password through the following command,

MySQL Password Strength Audit Plugin: validate_password instructions for usehttp://www.xuchanggang.cn/archives/1033.html


SHOW VARIABLES LIKE 'validate_password%';




You can configure the parameters by using the following commands, and the most important parameters for password strength requirements are the following policies

set global validate_password.policy=LOW;




Re-enforcement

UPDATEmysql.user SET authentication_string = 'root123'  WHERE User = 'root';




So the final command to change the password is

UPDATEmysql.user SET authentication_string = 'root123'  WHERE User = 'root';




6. Stop the mysql service

systemctl stopmysqld

7. Cancel the previously set option to skip permission checks

systemctl unset-environment MYSQLD_OPTS

8. Start mysql normally

systemctl start mysqld

9. Log in with the new password you set earlier

mysql -u root -p



Problems logging in reference:http://blog.csdn.net/u014306472/article/details/78160427



Review the default password

grep "temporary password"/var/log/mysqld.log



Here is a copy of the above command written in one piece, so that the copy is executed only once, not 3 times

Before logging in again, set the skip permission to check systemctl stop mysqld. systemctl set-environmentMYSQLD_OPTS="--skip-grant-tables"; systemctl start mysqld
Reset
After the setting is completed, reply to the permission check systemctl stopmysqld. systemctl unset-environment MYSQLD_OPTS; systemctl start mysqld;





Previous:YouCore Thinking Training: Solve problems with frameworks
Next:Public Administration Electronic Version Materials
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com