mysql安装步骤参考前面的5.7版本安装, 步骤一样
初始化时也是使用的--initialize-insecure参数
mysql/bin/mysqld --initialize-insecure --user=mysql8 --basedir=/home/mysql8/app/mysql --datadir=/home/mysql8/data
使用安全模式登录并修改root密码并授权远程登录
flush privileges; ALTER USER 'root'@'localhost' IDENTIFIED BY ''; flush privileges; use mysql update user set host = '%' where user = 'root'; flush privileges;
#后期维护过程
1. ./mysqld_safe --skip-grant-tables --skip-networking &
2. flush privileges;
3. ALTER USER 'root'@'%' IDENTIFIED BY '';
4. flush privileges;
# 启动mysql服务
5. /home/mysql8/app/mysql/support-files/mysql.server start
# 链接串
mysql -h123.123.123.130 -uroot -p
使用mysql软件目录bin下的mysql连接数据库, 连接上后设置验证方式
mysql -uroot -p -h192.168.10.130 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; flush privileges;
最后一个alter解决的是使用低版本mysql客户端连接服务时报错
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory