Installing CUBRID and related Drivers on Fedora and Centos Linux
The goal of this tutorial is to explain the steps required in order to install CUBRID using the CUBRID yum repositories. It is intended for users that have Fedora 13 or above, respectively Centos 6 and above, who want to easily install CUBRID from Fedora repos or Centos repos. This article will also show how to run a few simple commands that require root privileges.
CUBRID 8.4.1 is now also available for Fedora 13-16 and Centos 6.0 - 6.2.Overview
CUBRID builds are available on CUBRID yum repositories starting with CUBRID version 8.3.1. Every time a new release is announced, we will be uploading it to CUBRID yum repositoryes.
There are two ways to install CUBRID:
- In command line.
- Using Yumex GUI Installer.
We will go through each of these steps one by one.
Command Line
Step 1 – Setup yum to use CUBRID Repository
First of all, we must add the repository settings to yum configuration. To perform this step we prepared an RPM package customized for Fedora and CentOS distributions. RPM installation requires root access, so it must be run either from the root console or by using the sudo or su commands.
The following code will install yum settings for Fedora 13 instalation and CUBRID 8.4.0 binaries.
rpm -i http://yumrepository.cubrid.org/cubrid_repo_settings/8.4.0/cubridrepo-8.4.0-1.fc13.noarch.rpm
- For other operating systems, replace fc13 in the url above with fc14, fc15, fc16 (for other versions of Fedora) or el5.6, el6, el6.1, el6.2 (for Centos versions).
- To install yum settings for other versions of Fedora or Centos use the links from: http://www.cubrid.org/yum_repository
Once copied, paste it like rpm -i YOUR_PATH where YOUR_PATH is the path your obtained on those pages.
Using yum search cubrid a user can see a list of availlable CUBRID packages :
[root@vfc14-x64 ~]# yum search cubrid
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
========================================== Matched: cubrid ===========================================
cubrid.x86_64 : CUBRID: a very fast and reliable SQL database server
cubridrepo.noarch : Cubrid Repository Configuration
cubrid-compat.x86_64 : Cubrid compatibility tools and scripts
cubrid-demo.x86_64 : Cubrid demo database and scripts
cubrid-devel.x86_64 : Developement files for cubrid
cubrid-libs.x86_64 : Cubrid libraries
cubrid-manager-server.x86_64 : cubridmanagerserver
php-cubrid.x86_64 : php api for CUBRID
python-cubrid.x86_64 : python api for CUBRID 4
Step 2 – Installing CUBRID
In order to perform the installation after adding the repository settings, all we need to do is to run yum install ... with root privileges:
yum install cubrid
If you prefer a graphical installation, you can use the yumex (for Fedora), see below.
Remember: After the installation, you must restart your computer in order for the CUBRID PATH variables to be set. A reloging is generally faster and will have similar effect.
In case you want to use CUBRID without restarting, every time you open a new terminal window you must type the command:
. /etc/profile.d/cubrid.sh
Make sure that there is a space between the point and /etc or the command won’t work properly. This command sets the PATH variables temporarily for that terminal window. They remain set until the terminal window is closed.
Note: If you connect as a different user and the "cubrid" command is not found, then you must run the above ". /etc/profile.d/cubrid.sh" command in order to set the correct environment variables.
Step 3 - Installing CUBRID Manager
Now that we have installed CUBRID, we can install the optional CUBRID Manager Server. This is needed to provide a management interface to CUBRID Manager client application. You can find the packages in the same yum repository as the CUBRID package.
yum install cubrid-manager-server
This will install the CUBRID Manager server which will load on startup alongside cubrid.
Note : In order to be able to connect from a remote machine with CUBRID Manager Client, the firewall settings may need to be changed. Please refer to 'system-config-firewall" manual for your distribution and also CUBRID settings for required ports that need to be allowed.
Step 4 – Running CUBRID Commands
Congratulations! You have successfully installed CUBRID. If you want to run CUBRID commands however, there is one more thing you should take into consideration. CUBRID is installed by default into /usr/share/cubrid folder where the normal user has only read access.
Therefore, if you are not the root user, you must precede all commands that require creation of files (such as cubrid server start or cubrid createddb database_name) with "su -c" as in the examples below.
su -c "cubrid createdb test" su -c "cubrid server start test"
Note: sample init.d service script is by default installed into /etc/init.d/cubrid. Therefore you may use chkconfig command to automatically start CUBRID when your system starts.
Step 5 - Installing PHP API
In case you want to access CUBRID databases from within the php code, then you can install php-cubrid package:
yum install php-cubrid
This will automatically install dependent php packages.
Note that after installation your web server must be restarted for php to reload the modules:
service httpd restart
Step 6 - Installing Python API
In case you want to access CUBRID databases from within the python code, then you can install python-cubrid package:
yum install python-cubrid
This will automatically install dependent python packages.
Uninstalling CUBRID
If you want to uninstall CUBRID, the procedure is almost identical to the one for the installation. You only need to run:
yum erase cubrid
Your system will uninstall CUBRID as shown below. Note that yum will erase dependencies as well.
Summary
This concludes the tutorial for installing CUBRID on Fedora and CentOS from CUBRID yumrepository. We hope that you found this tutorial useful and that it helped you understand how to install, run and remove CUBRID. Let us know your feedback and remember to periodically check CUBRID Tutorials at http://www.cubrid.org/tutorials for more tutorials and resources.
Known Limitation
Curently Centos 5.6 and CUBRID 8.3.1 may present issues when installed via yum. For this case RPM packages can be found here: http://yumrepository.cubrid.org/cubrid3.1/Centos/5.6/
