mysql 授权远程访问
1.进入cd /usr/local/mysql/bin 下执行 ./mysql -uroot -pInfosec@2020 (-p后面是数据库密码)
2.use mysql;
3.update user set host = '%' where user='root';
4.select host,user from user;
3.flush privileges;
mysql 数据库备份
cd /usr/local/mysql/bin
./mysqldump -uroot -p"Infosec@2020" --databases netauth > /srv/netauth20230130.sql
redis
service redisd start
rm -rf /var/run/redis_6379.pid
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
处理方法:到远程服务器mysql命令下执行 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Infosec@2020';