1. Download the Linux version from the official website: https://dev.mysql.com/downloads/mysql/5.7.html 2. Upload the tarball to the server to /usr/local/src 3. Uninstall the system's automatic Mariadb 4. Check if mysql exists rpm -qa|grep -i mysql 5. Check if there is still a mysql directory 6. Unzip: tar -zxvf 7. Change the name: mv mysql-5.7.28-linux-glibc2.12-x86_64/mysql-5.7.28 8. Check if the mysql group and user exist, if not create them cat /etc/group | grep mysql cat /etc/passwd | grep mysql Create a mysql group and create a mysql user to join the mysql group groupadd mysql useradd -g mysql mysql passwd mysql #Set password 8. Change the group and user [root@localhost src]# chown -R mysql mysql-5.7.28/ [root@localhost src]# chgrp -R mysql mysql-5.7.28/ 9. Create data 10. Delete my.cnf under etc: rm -rf /etc/my.cnf; create my.cnf [mysql] # Set the default character set of the mysql client to default-character-set=utf8 [mysqld] skip-name-resolve #Set port 3306 port = 3306 # Set the installation directory of mysql to basedir=/usr/local/src/mysql-5.7.28 # Set the storage directory of mysql database data datadir=/usr/local/src/mysql-5.7.28/data # Maximum number of connections allowed max_connections=200 # The default character set used by the server is the 8-bit latin1 character set character-set-server=utf8 # The default storage engine that will be used when creating a new table default-storage-engine=INNODB lower_case_table_names=1 max_allowed_packet=16M 11.Installation initialization: 12. Re-modify the permissions of each directory [root@localhost mysql-5.7.28]# chown -R root:root /usr/local/src/mysql-5.7.28/ [root@localhost mysql-5.7.28]# chown -R mysql:mysql /usr/local/src/mysql-5.7.28/data/ Start mysql /usr/local/src/mysql-5.7.28/bin/mysqld_safe --user=mysql & 13. [root@localhost bin]# ./mysql -u root -p # If there is no password by default, just press Enter 14. If you don’t remember the password, vi /etc/my.cnf and add: skip-grant-tables Save and exit (:wq) 15. Restart mysql: service mysqld restart , then ./mysql -u root -p and press Enter 16. Change password: flush privileges; quit; 18. Modify my.cnf again: vi /etc/my.cnf Delete the skip-grant-tables just added, save and exit (:wq) 19. Restart mysql: service mysqld restart; ./mysql mysql -u root -p to enter 20. If this occurs systemctl stop firewalld.service #Shut down the firewall servicesystemctl disable firewalld.service #Disable the firewall to start firewall-cmd --state #Check the firewall statusservice mysqld restart 21. Modification Permissions use mysql; grant all privileges on *.* to root@"%" identified by "123456"; 22. If an error occurs SET PASSWORD = PASSWORD('123456'); 23. Connection successful Summarize The above is the installation tutorial of MySQL 5.7.28 under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you! You may also be interested in:
|
<<: Detailed explanation of several commands in Linux to obtain detailed hardware information
>>: jQuery implements all selection and reverse selection operation case
With the right settings, you can force Linux user...
Today, when we were learning about the Niu Nan new...
This article example shares the specific code of ...
When making some pages, in order to make the page...
String extraction without delimiters Question Req...
Since myeclipse2017 and idea2017 are installed on...
There are many form elements. Here is a brief sum...
Docker runs multiple Springboot First: Port mappi...
In order to centrally manage the images we create...
mysql 8.0.22 winx64 installation and configuratio...
This article mainly focuses on the installation a...
In Linux, there are two types of file connections...
This article mainly introduces how to implement a...
This article shares the specific code of jQuery t...
Table of contents Preface SQL statement optimizat...