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

CentOS 7 yum installation and configuration mysql

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

First of all, go to the official website to download the yum source to be used.

Portal: http://dev.mysql.com/downloads/repo/yum/

Yum source file: / home/mysql57-community-release-el7-8.noarch.rpm

Is a rpm package, if it is Gnome, you can choose the centos7 package installer to install. You can also install it as a command:

Rpm-ivh / home/mysql57-community-release-el7-8.noarch.rpm

Use yum search mysql to find packages related to mysql

Mysql-community-server.x86_64

Mysql-community-client.x86_64

The 64-bit system can install these two packages.

Sudo yum install mysql-community-server.x86_64 mysql-community-client.x86_64

After installation is complete

Service restart mysqld [pinnsvin@pinnsvin applications] $mysql-urootERROR 2002 (HY000): Can't connect to local MySQL server through socket'/ var/lib/mysql/mysql.sock' (2) [pinnsvin@pinnsvin applications] $service mysqld restartRedirecting to / bin/systemctl restart mysqld.service [pinnsvin@pinnsvin applications] $mysql-urootERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

After mysql-5.7, in order to strengthen the security of the database, a random password was added. If the normal installation is successful, there will be a prompt that the random password has been generated and stored in / root/.mysql_secret, so I looked at it.

[root@pinnsvin ~] # cat / root/.mysql_secretcat: / root/.mysql_secret: there is no file or directory [root@pinnsvin ~] #

No catalogue, headache, because he is a linux rookie, and finally ask for help

"mysql5.7 has changed in password management. The password will be written to the mysql error log during initialization. You can filter the log file by using the grep-I password command."

Add: / var/log/messages directory may have mysqld.log. You can also search / password in this file.

Finally found the password and successfully entered mysql. The first step to enter is to change the password.

Alter user 'root'@'localhost' identified by' password'

The strength of the password is required, and the password above must not work.

My-default.cnf under / usr/share/mysql

Just modify the corresponding parameters.

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

Database

Wechat

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

12
Report