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 mysql
Find 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_secret
So 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 password
Command 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/mysql
Lower
Modify the parameters.
Another major wave of portals:
MySQL my. cnf Parameters
Linux: view the software installation path
CentOS directory structure details
RPM Installation