美文网首页
MySQL-安装

MySQL-安装

作者: Zeppelin421 | 来源:发表于2022-02-08 14:33 被阅读0次

安装

  • 卸载

rpm -qa | grep -i mysql
rpm -e mysql-libs-xxx.el6.x86_64 --nodeps

wget -i -c https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-community-server-5.7.34-1.el7.x86_64.rpm

  • 安装

yum -y install mysql-community-server-5.7.34-1.el7.x86_64.rpm
yum -y install mysql-community-server

启动

systemctl start mysqld.service
systemctl status mysqld.service
systemctl stop mysqld.service
systemctl restart mysqld.service

登录

  • 查找初始密码

grep "password" /var/log/mysqld.log


  • 登录

mysql -uroot -p

  • 修改密码
    注意:密码设置必须要大小写字母数字和特殊符号(,/';:等),不能省略分号

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

  • 开启远程访问

grant all privileges on . to 'root'@'%' identified by 'remote password' with grant option;
flush privileges;

修改编码

进入mysql 查看当前编码

vim /etc/my.cnf


相关文章

网友评论

      本文标题:MySQL-安装

      本文链接:https://www.haomeiwen.com/subject/gtmnyltx.html