Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Mysql with the official Yum source on Centos7

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install Mysql with the official Yum source on Centos7". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install Mysql with the official Yum source on Centos7.

1. Download the repo source for mysql

$wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

two。 Install the mysql-community-release-el7-5.noarch.rpm package

$sudo rpm-ivh mysql-community-release-el7-5.noarch.rpm after installing this package, you will get two yum repo sources for mysql: / etc/yum.repos.d/mysql-community.repo/etc/yum.repos.d/mysql-community-source.repo

3. Install mysql

$sudo yum install mysql-server

It is OK to install according to the steps, but after the installation is complete, there is no password and you need to reset the password.

4. Reset password

Log in before you reset your password

$mysql-u root may report such an error when logging in: ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/ var/lib/mysql/mysql.sock' (2) due to access to / var/lib/mysql. The following command changes the owner of / var/lib/mysql to the current user: $sudo chown-R openscanner:openscanner / var/lib/mysql, then restart the service: $service mysqld restart next log in to reset password: $mysql-u rootmysql > use mysql;mysql > update user set password=password ('123456') where user='root';mysql > exit

5. Open port 3306

$sudo vim / etc/sysconfig/iptables add the following:-An INPUT-p tcp-m state-- state NEW-m tcp-- dport 3306-j ACCEPT save and restart the firewall: $sudo service iptables restart

This allows you to connect to the mysql service from other clients.

At this point, I believe you have a deeper understanding of "how to install Mysql with the official Yum source on Centos7". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report