在使用sqoop导入数据连接mysql数据库的过程中报错: Access denied for user ‘root’@'localhost’
运行 mysql_secure_installation(mysql安全向导)可能是linux中安装mysql时就没有设置正确
运行后有5个选项:
(根据需求选择Y/N)
- 为root用户设置密码
Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables…
… Success!
- 删除匿名账号
Remove anonymous users? [Y/n] Y … Success!
- 取消root用户远程登录(这个选N)
Disallow root login remotely? [Y/n] N … skipping.
- 是否删除test数据库
Remove test database and access to it? [Y/n] Y … skipping.
- 刷新授权表使修改生效
Reload privilege tables now? [Y/n] Y … Success!
设置完成后再试就没问题了。