安装MySql

MySql的安装

下载地址:https://downloads.mysql.com/archives/community/

name=MySQL 5.7 Community Server
33 baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
rpm -ivh mysql57-community-release-el7-3.noarch.rpm
yum install -y mysql-community-server

查找安装位置:

rpm -qa | grep mysql
rpm -ql mysql-community-client-5.7.29-1.el7.x86_64
rpm -qal | grep mysql
yum search mysql
find / -name mysql
which mysql
whereis mysql
开启软件
ps -aux | grep mysql
ps -el | grep mysql

systemctl start mysqld
systemctl enable mysqld
grep 'password' /var/log/mysqld.log
mysql -u root -p

ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root123@';

开启远程访问

在mysql中执行:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Root123@' WITH GRANT OPTION;

firewall-cmd --zone=public --add-port=3306/tcp --permanent
重启防火墙:firewall-cmd --reload

posted @ 2020-02-24 16:35  windlog  阅读(93)  评论(0编辑  收藏  举报