本人踩了很多坑,首先安装mysql,并且确认能否正常使用,(我就因为版本升级不能用)
报错信息:Column count of mysql.user is wrong. Expected 43, found 42. Created with MySQL 50560, now running 50643. Please use mysql_upgrade to fix this error.
解决:https://blog.csdn.net/qq_33350186/article/details/72528810
启动失败
查看日志报错 java.sql.SQLException: Access denied for user 'root'@'ambari1' (using password: YES)
设置了很多遍root权限还是不行,我一直以为是我的主机IP地址的问题,因为用命令 mysql -h ambari1 -u root -p 一直登陆失败,然后报下边的错, -h 后边的地址换成 192.168.255.132 也不行,但是用 localhost 就可以登陆mysql,在这里走了很远,最后运行DDL表,登陆成功~
查看日志:more /var/log/ambari-server/ambari-server.log
确认mysql连接器放在正确的位置
ls /usr/share/java/mysql-connector-java.jar
如果没有,进入这个目录,执行:
yum install mysql-connector-java *
安装完后有提示需要运行DDL表
登录mysql,使用source命令运行/var/lib/ambari-server/resources下的ambari—mysql.sql文件,运行完之后便可以启动ambari了,
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
用户权限问题,是否每个地址都可以访问
解决:
grant all privileges on *.* to root@'%' identified by '******' //***表示数据库连接密码
或者:
grant all on *.* to root@localhost identified by 'root';