In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
How do I install mysql 5.7in CentOS 6 and CentOS7? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Step1. View the installed mysql:
# yum list installed | grep mysqlmysql-libs.x86_64 5.1.71-1.el6 @ anaconda-CentOS-201311272149.x86_64/6.5
Uninstall the current mysql:
# yum-y remove mysql-libs.x86_64
Step2. Download the dependencies required for installation:
Download here first, and choose according to your own Linux version. For example, I am Centos6.5, so choose the second one, and so on:
Upload the downloaded mysql80-community-release-el6-1.noarch.rpm file to the Linux server
Step3. Installation dependencies:
Using the following command, note that this command needs to be executed in the directory where the mysql80-community-release-el6-1.noarch.rpm file is located.
There will be an Is this ok [y] N]: during execution, and just type y.
# yum localinstall mysql80-community-release-el6-1.noarch.rpm
After execution, use the # ls / etc/yum.repos.d command to see that two more files have been added
# ls / etc/yum.repos.dmysql-community.repo mysql-community-source.repo
Step4. Run yum repolist enabled | grep mysql to see if mysql57 is available.
If the result of running is as follows:
# yum repolist enabled | grep mysqlmysql-connectors-community MySQL Connectors Community 59mysql-tools-community MySQL Tools Community 65mysql80-community MySQL 8.0 Community Server 29
You need to use the command vim / etc/yum.repos.d/mysql-community.repo to change the enabled of mysql57 to 1, while other versions set it to 0. 0. The details are as follows:
Vim / etc/yum.repos.d/mysql-community.repo
Modification section:
. # Enable to use MySQL 5.7 [mysql57-community] name=MySQL 5.7 Community Serverbaseurl= http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql. [mysql80-community] name=MySQL 8.0 Community Serverbaseurl= http://repo.mysql.com/yum/mysql-8.0-community/el/6/$basearch/enabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
The running result after setting is as follows:
# yum repolist enabled | grep mysqlmysql-connectors-community MySQL Connectors Community 59mysql-tools-community MySQL Tools Community 65mysql57-community MySQL 5.7 Community Server 273
Step5. Start the installation:
# yum install mysql-community-server
If you make an error and stop midway, it is usually because of the network speed. You can repeat this command.
Step6. After the installation is complete, start the mysql service (which may make an error the first time, then run it again):
# service mysqld startInitializing MySQL database: [FAILED] # service mysqld startStarting mysqld: [OK]
Step7. View the password of the default root user:
# cat / var/log/mysqld.log | grep root@localhost2018-08-29T03:11:26.560863Z 1 [Note] A temporary password is generated for root@localhost: DJ#erA*-p6&?
DJ#erA*-p6&? Is the initial password of the root user
Step8. To log in using the mysql-uroot-p command, you need to enter the password from the previous step.
After entering, any action will prompt ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. The password needs to be reset at this point:
Mysql > show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql > set password=password ('new_password'); Query OK, 0 rows affected, 1 warning (0.01 sec) mysql > alter user' root'@'localhost' password expire never;Query OK, 0 rows affected (0 sec) mysql > flush privileges;Query OK, 0 rows affected (0 sec) after reading the above, have you mastered how to install mysql 5.7 in CentOS 6 and CentOS7? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.