This is the fourth day of my participation in the November Gwen Challenge. See details: The last Gwen Challenge 2021.
- If the article is helpful to you, welcome to pay attention to, like, collect (one key three even), have any questions welcome private letter, see will reply in time!
preface
- Hello everyone, I am Xiaocheng, “from 0 to 1- comprehensive and profound understanding of MySQL series” the second article starts from the most basic installation of mysql-Linux environment, interested partners can follow me, the series of articles will continue to update, work together, progress together!
MySQL installation tutorial: From 0 to 1- A Thorough understanding of MySQL series – The most detailed MySQL installation process (Windows environment)
1. Delete the old version
MySQL > install mariadb MySQL > install mariadb MySQL > install mariadb MySQL > install mariadb MySQL > install mariadb MySQL > install mariadb MySQL > install mariadb
1, qa RPM – | grep mysql – is there a mysql query server, if any, is performed to remove the following statement
2, the RPM – qa | grep mariadb – query server whether have mariadb, have the implementation of the third step to delete
RPM -e –nodeps specifies the name of the file to be deleted.
2. Check the kernel type of the server, download the appropriate version, and upload it to the server
2.1. Run cat /proc/version to check the kernel type of the system
2.2. Download the appropriate type from the official website
2.3 Upload the file to the server using the Rz command or the XFTP tool
Tip 1: If you cannot find the rz command, run the yum -y install LRZSZ command to download the command online.
Command: rz or rz-be
Format: rZ-be Select the file to be uploaded
Upload files in batches or individually using the ZMODEM protocol. In addition, upload files using FTP or SFTP
Tip 2: If it takes a long time to upload using the Rz command, you can download an XFTP tool and use it to upload more efficiently. (I will not expand this tool in this article. If you need to, you can leave a comment below and we will expand the details in the following article.)
3. Decompress and gradually install the corresponding components
3.1 Decompress command: tar -xvf Name of the file to be decompressed -c path to be pressed (-c and the following parameters can be omitted)
3.2. Install components. RPM -ivh Specifies the name of the component to be installed
Follow the following command sequence, change the file name to your compressed file name
// mysql-community-common
1, the RPM - the ivh mysql - community - common -8.016.-2.el7.x86_64.rpm
// mysql-community-libs
2, the RPM - the ivh mysql - community - libs -8.016.-2.el7.x86_64.rpm --force --nodeps
// mysql-community-libs-compat
3, the RPM - the ivh mysql - community - libs - compat -8.016.-2.el7.x86_64.rpm
// mysql-community-client
4, the RPM - the ivh mysql - community - the client -8.016.-2.el7.x86_64.rpm --force --nodeps
// mysql-community-server
5, the RPM - the ivh mysql - community - server -8.016.-2.el7.x86_64.rpm --force --nodeps
// View installed components
6, the RPM - qa | grep mysqlCopy the code
3.3. Start the MySQL server. If an error occurs, go to Step 4
Start the systemctl start mysql command
3.4. If the following error is reported during startup, repair the fault by following steps
Error message: Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.
Run the systemctl status mysqld.service or journalctl -xe command to view the error information. The following information is displayed: Data Dictionary upgrade from MySQL 5.7 in Progress.
Note The package of the new version conflicts with that of the previous version of the server. Delete the directory that conflicts with the package and run the rm -rf /var/lib/mysql/* command.
3.5. Run the systemctl start mysql command to start the mysql service
4. Connect to the MySQL server and change the password
If you successfully start MySQL for the first time, a default password will be set. Run the following command to view and log in to MySQL.
1. Run the grep password /var/log/mysqld.log command to query the temporary password for the first startup
2, Connect to server: mysql -u root -p press Enter, and output password
3, the first connection will force you to change the connection password, you can use the following statement to change the password:
ALTER USER root@localhost IDENTIFIED WITH caching_sha2_password BY ‘123456’; (mysql8.x is suitable for this statement)
UPDATE USER SET PASSWORD=PASSWORD(‘ your PASSWORD ‘) WHERE USER=’root’; (mysql5.x modified)
5, summary
Short step, no thousands of miles; Not small streams, beyond into rivers and seas. Sow the seed of effort today, one day will germinate!
Welcome everyone to pay attention to, if you feel that the article is helpful to you, don’t forget one key three even oh, your support is my motivation to create more high-quality articles, there are any questions can be private letter to me, see will give you a timely reply! .