centos 6.5 安装mysql 5.7 发表于 2018-05-31 | 分类于 mysql centos 6.5 安装mysql 5.71234567891011121314151617#!/bin/bashyum -y remove mysql-libs*yum install -y numactlyum install -y perlyum install -y libaiorpm -ivh mysql-community-common-5.7.21-1.el6.x86_64.rpmrpm -ivh mysql-community-libs-5.7.21-1.el6.x86_64.rpmrpm -ivh mysql-community-client-5.7.21-1.el6.x86_64.rpmrpm -ivh mysql-community-server-5.7.21-1.el6.x86_64.rpmservice mysqld startmkdir /data/mysqlmkdir /data/tmpchmod 777 /data/tmpmkdir -p /data/log/mysql/chown mysql:mysql /data/mysqlchown mysql:mysql /data/log/mysql/ 修改myql5.7密码进入安全模式service mysqld stop mysqld_safe --skip-grant-tables & 修改密码123456789101112131415161718192021use mysql; set global validate_password_policy=0; SET PASSWORD = PASSWORD('bits@20180528!hhhaj11ddh~'); ALTER USER 'root'@'localhost' IDENTIFIED BY 'bits@asdfasdf2019019'; flush privileges;quit; set password=password("11@20180528!hzhz1d1dzh~");service mysqld stopservice mysqld start 修改8.0密码123456mysqld --initialize-insecure --user=mysqluse mysql;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';FLUSH PRIVILEGES; 添加用户12345678910111213set global validate_password_policy=0;Delete FROM user Where User='xcredit' and Host='%';flush privileges;create user dd identified by 'Cq&asdfasd9!#jq^J4K';GRANT ALL PRIVILEGES ON *.* TO 'dd'@'%' WITH GRANT OPTION;flush privileges; 设置root能远程访问12345GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'dd@201dafds90ddf19' WITH GRANT OPTION;FLUSH PRIVILEGES