Installing and Configuring MySQL as Backend Database on Linux
Overview
now supports MySQL as a backend database to store all the clients' backup metadata information. Unlike using SQLite embedded database as its backend database, the MySQL database Server is external to the backup server application. Using a client-server database as the backend database rather than an embedded database would provider better scalability and performance. It also enables third party applications to directly query 's metadata for integration with those applications. To get to work with MySQL as a backend database, you need to install MySQL Server either in the same machine where backup server is installed or in another dedicated machine where you wish to store the 's metadata information
Note : The following steps are also applicable for Replication Server using the MySQL database as a backend database.
Install and Configure MySQL Server
-
Download the zip file from the following links for the particular flavor of Linux that you are running in your backup (or replication) server.
If you don't find the download for the version of Linux you're looking for, then you need to do the manual installation as described here.
- Unzip the downloaded file. Run the file mysql_rpm_install.sh
- When prompted, choose the option 1 for installing rpms
- In the set of choices, choose the option 1 for installing all rpm packages
- The script will then install the following packages
- mysql-connector-odbc-3.51.27
- mysql-server-5.1.39-0.glibc23
- mysql-client-5.1.39-0.glibc23
- unixODBC-2.2.14-1
If any of the following dependency packages are missing, they will also be installed
- ncurses-5.5-24.20060715
- ncurses-devel-5.5-24.20060715
- perl-DBI-1.52-2.el5
Make sure MySQL instance is running fine by running the command:
mysql -u root -p
Create Database
The next step is to create the database in MySQL that the server will use.
- Login to the machine where MySQL Server is running.
- Execute the command mysql -u root -p and enter the password.
-
Create the database by executing the command:
create database [database name] collate latin1_general_cs;
where [database name] is the name of the database. Make sure the database name does not exceed 30 characters
Configure MySQL Connector
Now that you have all the packages installed, MySQL instance running and the MySQL database created, follow the steps mentioned below to configure the MySQL connector:
- Execute the following command from the command line
odbcinst -j
- Note the path of the odbcinst.ini file for DRIVERS. By default, it is /usr/local/etc/odbcinst.ini
- Login as root and open the file odbcinst.ini
- Append the following content to the file.
[ODBC]
Trace = No
Trace File = /tmp/sql.log
Pooling = Yes
[MySQL]
Description =
Driver = /usr/local/lib/libmyodbc3-3.51.27.so
Driver64 =
Setup = /usr/local/lib/libmyodbc3S-3.51.27.so
Setup64 =
UsageCount =1
CPTimeout =300
CPReuse =1
Threading =0
Note: If the ODBC Driver [ODBC] is already present in the file, please enable connection pooling by adding Pooling=Yes
Create System DSN
Execute the following steps to create a DSN for the Server to access the MySQL instance:
- Execute the following command from the command line
odbcinst -j
- Note the path of the odbc.ini file for SYSTEM DATA SOURCES. By default, it is /usr/local/etc/odbc.ini
- Login as root and open the file odbc.ini
- Append the following content to the file.
[sgserver]
Driver = MySQL
DATABASE = DB
PWD = password123
SERVER = lintest
UID = root
In the above example file, the name of the DSN is sgserver. The database name (specified as DB in the above example) should be that specified in step Create Database above. The server name (lintest) is the hostname of the server running the MySQL instance with the user root and password as password123.
Verify MySQL installation
To make sure the MySQL is configured correcting and is running, execute the command
isql -v [dsn name] [user name] [password]
at the command line in the backup server and make sure it is able to connect to the MySQL instance.
|