[mysql57-community] name=MySQL 5.7 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/ enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql修改后保存再次执行 yum install -y mysql-community-server 6.启动mysql /bin/systemctl start mysqld.service 7.修改密码 通过WinSCP找到etc目录下的my.cnf文件,直接在[mysqld]下添加"skip-grant-tables"(双引号不用加,作用是登录时跳过登录认证,空也可登录)保存 # mysql -uroot -p 进入mysql密码为任意数
mysql>use mysql;
mysql>update user set authentication_string=password(“newpassword“) where user=”root”;
mysql>flush privileges;