bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data ls support-files/ bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data cp support-files/mysql.server /etc/init.d/mysqld chkconfig mysqld on systemctl status mysqld systemctl start mysqld bin/mysql -uroot -p 输入密码 set password=password('1'); exit # password('密码')
添加环境变量
1 2 3 4 5 6 7 8 9 10 11 12 13 14
echo 'export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/sbin' >> /etc/profile source /etc/profile mysql -uroot -p1 #开启远程连接MySQL # 1为密码 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1' WITH GRANT OPTION; # 刷新 FLUSH PRIVILEGES; #查看 select user,host from mysql.user; exit #安全设置 bin/mysql_secure_installation; #输入密码后,前面两个分别为密码校验、不更改密码输入两次N,其余一直Y