In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to install mysql5.7.21tar.gz package on centos6.6", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to install mysql5.7.21tar.gz package on centos6.6" this article.
There are many ways to install mysql5.7.21 on linux. I am now installing a tar.gz binary package (the latest version). The whole process is completely tested, and all the noteworthy points in the process will be explained in detail. This is also where I encountered problems in the installation process. I have consulted a lot of installation documents, but they are all before 5.7.21, and there are few documents for the latest package. Therefore, it is necessary to produce a document.
1. Download the installation package on the mysql official website
As shown in the picture: it is the version I chose to download
2. Extract the installation package
The package is named mysql-5.7.21-linux-glibc2.12-x86_64.tar and unzipped to / usr/local
The command is: [root@localhost local] # tar-zxf / data/software/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz
3. Establish soft links
At this point, mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz has been extracted to / usr/local, named mysql-5.7.21-linux-glibc2.12-x86_64. For ease of management, a soft link is established for mysql-5.7.21-linux-glibc2.12-x86_64 in the current directory.
The command is: [root@localhost local] # ln-s mysql-5.7.21-linux-glibc2.12-x86_64 mysql
As shown in the figure:
4. Establish user groups and users
The command is:
[root@localhost local] # groupadd-g 501 mysql
[root@localhost local] # useradd-u 501-g mysql-c mysqldb-r-s / bin/false mysql
Here, it is necessary to explain-r-s / bin/false. In fact, this is officially recommended by mysql. It recommends that msyql users only be the owners of files or directories and do not have the permission to log in to shell.-r indicates that they are system users, and-s / bin/false indicates that mysql users do not have the right to log in to shell. Of course, you can also let mysql exist as a normal user with permission to log in to shell.
5. Set permissions, and make a note here. All files involving mysql set their owners and groups to mysql.
The command is: [root@localhost mysql] # chown-R mysql:mysql. /
As shown in the figure:
6. Install mysql
(1) the command is: [root@localhost mysql] # / bin/mysqld-- user=mysql-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data-- initialize
As shown in the figure:
Here, be sure to pay attention to the last generated initial password. Mysql needs to use this initial password when logging in for the first time. The current generated password is yrwj.Murwichd7wL.
(2) modify the permissions of / etc/my.cnf and edit the content
The command is: [root@localhost mysql] # chown-R mysql:mysql / etc/my.cnf
[root@localhost mysql] # vim / etc/my.cnf
As shown in the figure:
Special attention should be paid here that the paths of these four must be properly configured, otherwise not only the subsequent service will not start, but also an error about pid will be reported.
7. Start the service
The command is: [root@localhost mysql] #. / support-files/mysql.server start
The service starts correctly as shown in the figure:
8. Put the msyql process into the system process, so that you can start mysql through the system command
The command is:
[root@localhost mysql] # cp support-files/mysql.server / etc/init.d/mysqld
[root@localhost mysql] # chown-R mysql:mysql / etc/init.d/mysqld
Restart mysql with the system command to see if the system command is in effect:
The command is: [root@localhost mysql] # service mysqld restart
9. Set msyql to log in in any directory
The command is: [root@localhost mysql] # vim ~ / .bash_profile
Write export PATH=$PATH:/usr/local/mysql/bin at the bottom (your installation bin directory)
[root@localhost mysql] # source ~ / .bash_profile
10. Log in to the mysql database and enter the initial password
The command is: [root@localhost mysql] # mysql-uroot-p
11. Set a new password for root users
Mysql > alter user 'root'@'localhost' identified by "123456"
12. Modify the root user to log in from any client.
Mysql > update user set host ='% 'where user =' root'
Mysql > flush privileges
13. Turn off the firewall of linux so that remote tools can log in
[root@localhost ~] # chkconfig-- list | grep iptables
[root@localhost] # chkconfig-- level 2345 iptables off
[root@localhost] # shutdown-r now
The above is all the contents of the article "how to install mysql5.7.21tar.gz package on centos6.6". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.