初始化报该错CDH 初始化数据库 报错ERROR Exception when creating/dropping database with user ‘root’ and jdbc url ‘jdbc:mysql://localhost/?useUnicode=true&characterEncoding=UTF-8’,原因是没有该用户,无法创建。

初始化命令格式:
CDH 初始化数据库 报错ERROR Exception when creating/dropping database with user 'root' and jdbc url 'jdbc:mys

解决方法:进到mysql数据库里添加创建用户,格式如下
grant all privileges on . to ‘root’@‘localhost’ identified by ‘123456’ with grant option;

grant all privileges on . to ‘root’@‘hadoop1’ identified by ‘123456’ with grant option;

grant all privileges on . to ‘root’@‘127.0.0.1’ identified by ‘123456’ with grant option;

grant all privileges on . to ‘root’@’%’ identified by ‘123456’ with grant option;

grant all privileges on . to ‘scm’@‘localhost’ identified by ‘scm’ with grant option;

grant all privileges on . to ‘scm’@‘hadoop1’ identified by ‘scm’ with grant option;

grant all privileges on . to ‘scm’@‘127.0.0.1’ identified by ‘scm’ with grant option;

grant all privileges on . to ‘scm’@’%’ identified by ‘scm’ with grant option;

PS。如果数据库里有cm和scm表,需要先删除在重新初始化。

相关文章:

  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2021-07-26
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
相关资源
相似解决方案