Using Ambari with MySQL
To set up MySQL for use with Ambari:
On the Ambari Server host, install the connector.
Install the connector
RHEL/CentOS/Oracle Linux
yum install mysql-connector-javaSLES
zypper install mysql-connector-javaDebian/Ubuntu
apt-get install libmysql-javaConfirm that
.jaris in the Java share directory.ls /usr/share/java/mysql-connector-java.jarMake sure the .jar file has the appropriate permissions - 644.
Create a user for Ambari and grant it permissions.
For example, using the MySQL database admin utility:
# mysql -u root -pCREATE USER '<AMBARIUSER>'@'%' IDENTIFIED BY '<AMBARIPASSWORD>';GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'%';CREATE USER '<AMBARIUSER>'@'localhost' IDENTIFIED BY '<AMBARIPASSWORD>';GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'localhost';CREATE USER '<AMBARIUSER>'@'<AMBARISERVERFQDN>' IDENTIFIED BY '<AMBARIPASSWORD>';GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'<AMBARISERVERFQDN>';FLUSH PRIVILEGES;Where
<AMBARIUSER>is the Ambari user name,<AMBARIPASSWORD>is the Ambari user password and<AMBARISERVERFQDN>is the Fully Qualified Domain Name of the Ambari Server host.
Load the Ambari Server database schema.
You must pre-load the Ambari database schema into your MySQL database using the schema script.
mysql -u <AMBARIUSER> -pCREATE DATABASE <AMBARIDATABASE>;USE <AMBARIDATABASE>;SOURCE Ambari-DDL-MySQL-CREATE.sql;Where <AMBARIUSER> is the Ambari user name and <AMBARIDATABASE> is the Ambari database name.
Find the
Ambari-DDL-MySQL-CREATE.sqlfile in the/var/lib/ambari-server/resources/directory of the Ambari Server host after you have installed Ambari Server.
When setting up the Ambari Server, select
Advanced Database Configuration > Option [3] MySQLand enter the credentials you defined in Step 2. for user name, password and database name.

