centos6.9 安装mysql

/*

yum -y install lrzsz
*/
删除 mariadb 包
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64


下载 http://www.mysql.com/downloads/

http://dev.mysql.com/get/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar

https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar

mkdir mysql
tar -vxf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar -C mysql
cd mysql

rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.26-1.el7.x86_64.rpm

报错
/usr/bin/perl 被 mysql-community-server-5.7.26-1.el7.x86_64 需要
net-tools 被 mysql-community-server-5.7.26-1.el7.x86_64 需要
perl(Getopt::Long) 被 mysql-community-server-5.7.26-1.el7.x86_64 需要
perl(strict) 被 mysql-community-server-5.7.26-1.el7.x86_64 需要
安装依赖包
yum install -y perl-Module-Install.noarch
yum install net-tools

设置开机启动并启动
systemctl enable mysqld
systemctl start mysqld

查找密码
find / -name mysqld.log
grep 'temporary password' /var/log/mysql/mysqld.log

登录
mysql -u root -p

修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '密码'

授权远程登录 新加用户
GRANT ALL PRIVILEGES ON *.* TO 'mysql'@'%' IDENTIFIED BY 'new密码' WITH GRANT OPTION;
FLUSH PRIVILEGES


lsof -i tcp:80
netstat -ntlp

查看防火墙状态命令
firewall-cmd --state

启动防火墙命令
systemctl start firewalld

查看已开放的端口
firewall-cmd --list-ports

开放新端口
firewall-cmd --zone=public --add-port=81/tcp --permanent

开放连续端口
firewall-cmd --zone=public --add-port=82-85/tcp --permanent

重启防火墙
firewall-cmd --reload

猜你喜欢

转载自www.cnblogs.com/youjiao/p/12907404.html
今日推荐