Installing and Configuring MySQL as Gbackup Backend Database on Linux
Gbackup now supports MySQL as a backend database to store all the clients' backup metadata information. Unlike Gbackup using SQLite embedded database as its backend database.
- Overview
- Install MySQL and its dependency packages
- Create Gbackup Database
- Configure MySQL Connector
- Create System DSN
- Verify the installation
Overview
Gbackup now supports MySQL as a backend database to store all the clients' backup metadata information. Unlike Gbackup using SQLite embedded database as its backend database, the MySQL database Server is external to the Gbackup 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 Gbackup's metadata for integration with those applications. To get Gbackup to work with MySQL as a backend database, you need to install MySQL Server either in the same machine where Gbackup backup server is installed or in another dedicated machine where you wish to store the Gbackup's metadata information
Note : The following steps are also applicable for Gbackup 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.
Operating System Size Download DEBIAN/UBUNTU [64-Bit] 64.7 MB Download DEBIAN/UBUNTU [32-Bit] 52.42 MB Download CENTOS [64-Bit] 64.24 MB Download CENTOS [32-Bit] 63.49 MB Download SUSE [64-Bit] 63.16 MB Download SUSE [32-Bit] 55 MB Download RedHat [64-Bit] 64.04 MB Download RedHat [32-Bit] 55 MB Download 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
- 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
The next step is to create the database in MySQL that the Gbackup 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 Gbackup 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 Gbackup 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 = GbackupDB
PWD = password123
SERVER = lintest
UID = root
In the above example file, the name of the DSN is sgserver. The database name (specified as GbackupDB in the above example) should be that specified in step Create Gbackup Database above. The server name (lintest) is the hostname of the server running the MySQL instance with the user root and password as password123.
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.


