时间:2021-07-01 10:21:17 帮助过:3人阅读
[root@localhost ~]# cd /root/software
[root@localhost src]# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
[root@localhost src]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm
[root@localhost src]# yum -y install mysql-server
备注:一路Y就可以
[root@localhost src]# service mysqld restart
注意:为随机密码,需重置密码
[root@localhost src]# grep "passwor" /var/log/mysqld.log
[root@localhost src]# mysql -u root –p
登陆后会发现需要重置密码
alter user ‘root‘@‘localhost‘ identified by ‘Root!!2018‘; (注意:必须包含 数字字母符号)
flush privileges;
增加root用户指定可以任意IP登录,如果想限制只能让指定IP登录请把%替换成IP地址
grant all on *.* to ‘root‘@‘%‘ identified by ‘ Root!!2018‘ with grant option;
备注:
默认配置文件路径:
配置文件:/etc/my.cnf
日志文件:/var/log/var/log/mysqld.log
服务启动脚本:/usr/lib/systemd/system/mysqld.service
socket文件:/var/run/mysqld/mysqld.pid
centos安装mysql
标签:res href 远程 centos efi var 配置 localhost height