Install and configure mysql and centosyum in CentOS 7 yum

Source: Internet
Author: User

Install and configure mysql and centosyum in CentOS 7 yum

First, go to the official website to download the yum Source
Transport: http://dev.mysql.com/downloads/repo/yum/
Yum source file:/home/mysql57-community-release-el7-8.noarch.rpm
Is an rpm package. If it is Gnome, you can select centos7 package installer to install it. You can also run the following command to install the SDK:

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

Useyum search mysqlFind mysql-related packages
Mysql-community-server.x86_64
Mysql-community-client.x86_64
Install these two packages in a 64-bit system.

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

After installation is complete

service restart mysqld
[pinnsvin@pinnsvin applications]$ mysql -u rootERROR 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)

Mysql-5.7 in order to enhance the security of the database, added a random password, if the normal installation is successful, there will be a prompt that the random password has been generated and stored in/root/.mysql_secretSo I looked

[Root @ pinnsvin ~] # Cat/root/. mysql_secretcat:/root/. mysql_secret: No file or directory [root @ pinnsvin ~] #

No directory, headache, because it is linux, and finally ask for help

"Mysql5.7 has changed the password management. The password will be written to the mysql error log during initialization. You can usegrep -i passwordCommand to filter log files"

Finally, find the password and enter mysql. First, change the password.

alter user 'root'@'localhost' identified by 'password';

The password strength is required. The above password is definitely not valid.

My-default.cnf in/usr/share/mysqlLower

Modify the parameters.

Another major wave of portals:

MySQL my. cnf Parameters
Linux: view the software installation path
CentOS directory structure details
RPM Installation

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.