如何从主机访问hadoop VM中的mysql

时间:2018-07-12 09:36:19

标签: mysql hadoop ambari

我正在尝试通过VM hadoop连接到mysqL,出现此错误:

# mysql -u root -p
-bash: mysql: command not found

我确认.jar在Java共享目录中:

# ls /usr/share/java/mysql-connector-java.jar
/usr/share/java/mysql-connector-java.jar

执行以下命令:

# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
Using python  /usr/bin/python
Setup ambari-server
Copying /usr/share/java/mysql-connector-java.jar to /var/lib/ambari-server/resources
If you are updating existing jdbc driver jar for mysql with mysql-connector-java.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts.
JDBC driver was successfully initialized.
Ambari Server 'setup' completed successfully.

我如何无法连接到mysql? 谢谢

0 个答案:

没有答案