前面安装教程建议参考:https://www.runoob.com/mysql/mysql-install.html
安装前准备: 删除 mysql数据库 和mariadb 自带的数据库(若有)
只说下安装后容易遇到的坑:

密码重置:

/etc/my.cnf

配置: skip-grant-tables  这样可以不输入密码进入mysql

进入mysql,首先刷新权限

flush privileges;

然后查看表结构,可以看到密码字段是authentication_string

update user set authentication_string=password('123456') where user='root';

flush privileges;

 

用户授权远程访问:

#创建账户
create user 'root'@'%' identified by  'password'
#赋予权限,with grant option这个选项表示该用户可以将自己拥有的权限授权给别人
grant all privileges on *.* to 'root'@'%' with grant option
#改密码&授权超用户,flush privileges 命令本质上的作用是将当前user和privilige表中的用户信息/权限设置从mysql库(MySQL数据库的内置库)中提取到内存里
flush privileges;

 

mysql 客户端远程登陆:Client does not support authentication protocol requested by server ; consider upgrading MySQL client

解决方案:1升级驱动   大家可以试一下

2 修改数据库加密规则

 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码';

FLUSH PRIVILEGES;    

 

相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2021-05-31
  • 2021-05-23
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-12
  • 2021-07-17
  • 2021-05-03
  • 2021-06-22
  • 2022-12-23
  • 2021-06-15
  • 2021-09-25
相关资源
相似解决方案