Home > Database > Mysql Tutorial > body text

Detailed steps for rpm installation of mysql installation

不言
Release: 2019-03-12 17:36:56
forward
3055 people have browsed it

The content of this article is about the detailed steps of rpm installation of mysql installation. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

View installation and uninstallation

# 查看
rpm -qa | grep mysql
# 卸载
yum -y remove mysql-libs-5.1.66-2.el6_3.x86_64
Copy after login

1.centos7 needs to uninstall mariadb first
View command rpm -qa | grep mariadb

Installation package resource address

mysql download address

# 下载资源名称
mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar
Copy after login

Unzip the resource

tar -xvf mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar
Copy after login

Get the rpm package

mysql-community-common-5.7.19-1.el6.x86_64.rpm
mysql-community-client-5.7.19-1.el6.x86_64.rpm
mysql-community-server-5.7.19-1.el6.x86_64.rpm
mysql-community-libs-5.7.19-1.el6.x86_64.rpm
Copy after login

Installation

# 安装顺序
# common --> libs --> clients --> server
# 安装命令
rpm -ivh mysql-community-common-5.7.19-1.el6.x86_64.rpm mysql-community-libs-5.7.19-1.el6.x86_64.rpm mysql-community-client-5.7.19-1.el6.x86_64.rpm mysql-community-server-5.7.19-1.el6.x86_64.rpm
Copy after login
may need to rely on the package libaio
Installation Command yum -y install libaio

Initialization

mysqld --initialize --user=mysql
Copy after login

Startup

service mysqld start
Copy after login

Login

# 查看初始密码
cat /var/logs/mysql.log

#或者
grep 'password' /var/logs/mysql.log -n -B 5

# 登陆
mysql -uroot -p'123456'
# 修改初始密码
set PASSWORD=PASSWORD('密码');
Copy after login

Authorized remote link

### 授权192.168.0.1可以远程链接*[所有数据库].*[所有表] 账号:root 密码123456
grant all privileges on *.* to 'root'@'192.168.0.1' identified by '123456';

### 授权所有ip
grant all privileges on *.* to 'root'@'%' identified by '123456';

### 以上*.*表示[数据库].[表]


### 使授权立刻生效
flush privileges;
Copy after login

The above is the detailed content of Detailed steps for rpm installation of mysql installation. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!