Using yum linux source mounting mysql5.7

Copyright: copyright reserved by the authors, are reproduced in any form, please indicate the source. https://blog.csdn.net/xiaokui9/article/details/88976164

yum list no mysql, originally installation package first attempts to use downloaded, but always unsuccessful, so use yum install

1, install mysql

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update

If not wget, such as a command: yum -y install wget, installation.

Then found looks like a 5.6 version, so look for another article.

2, modify the mysql version of yum.

Another article all of the following, but because I have run the preceding three commands, so the first line of command is not executed.

# 安装MySQL的yum源,下面是RHEL6系列的下载地址

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

# 安装yum-config-manager

yum install yum-utils -y

# 禁用MySQL5.6的源

yum-config-manager --disable mysql56-community

# 启用MySQL5.7的源

yum-config-manager --enable mysql57-community-dmr

# 用下面的命令查看是否配置正确

yum repolist enabled | grep mysql

wKioL1SY183ToG_4AAEh07Jk3jc235.jpg

# 安装MySQL5.7

yum install mysql-community-server

期间会有很多问,回答y就行。

 

3, start mysql

Here there have been all kinds of error, press the start of this process is complete.

Permissions (where / var / lib / mysql directory consistent with /etc/my.cnf inside):

[root@host]# chown mysql:mysql -R /var/lib/mysql

Initialization MySQL:

[root@host]# mysqld --initialize

After initialization attention to check the / var / lib / mysql directory and directory permissions to modify all the files are correct, if not modified, then execute this command again in the mysql directory.

Start MySQL:

[root@host]# systemctl start mysqld

View MySQL running state:

[root@host]# systemctl status mysqld

Verify MySQL installation
[root @ host] # mysqladmin --version

4, access mysql

Here also use mysqladmin -u root password '123456' command has been given, can not enter. I found a third article, into the process is as follows:

At this time, MySQL has started running, but in order to enter at this time MySQL had to first find out the root user password, you can find the password in the log file with the following command:

[root@localhost ~]# grep "password" /var/log/mysqld.log


  The following command into the database:

[root @ localhost ~] # mysql -uroot -p
  input the above-generated temporary initial password, this time can not do anything, because to operate after MySQL database default password must be changed:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

This completes the installation.

 

5. Other

Installation see if there is installed: 

 yum list installed mysql*

 rpm -qa | grep mysql* 

See if there is an installation package:

 yum list mysql* 

 

Reference pages:

http://www.runoob.com/mysql/mysql-install.html

https://www.cnblogs.com/sweet521/p/6196732.html

https://www.cnblogs.com/luohanguo/p/9045391.html

Guess you like

Origin blog.csdn.net/xiaokui9/article/details/88976164