Open source database highly optimized for Web applications

한국어 Login Register

CUBRID Ubuntu Launchpad Installation

Published on: 14 Feb 2012 Updated on: 11 May 2012 CUBRID Version: 8.3.1, 8.4.0, 8.4.1

The goal of this tutorial is to explain the steps required in order to install CUBRID using the Launchpad repositories. It is intended for users that have Ubuntu 10.04 or above, who want to easily install CUBRID from Ubuntu repos. This article will also show how to run a few simple commands that require root privileges.

Overview

CUBRID builds have been available on Launchpad since version 8.3.1. Now you can also install CUBRID 8.4.0 and CUBRID 8.4.1 from Launchpad. Every time a new release is announced, we will be uploading it to Launchpad.

CUBRID installation packages on Launchpad are available for Ubuntu 10.04 (Lucid Lynx), Ubuntu 10.10 (Maverick Meerkat), Ubuntu 11.04 (Natty Narwhal), Ubuntu 11.10 (Oneiric Ocelot) and Ubuntu 12.04 (Precise Pangolin).

Step 1 – Add Repository

First of all, we must add the repository to the sources list using 2 commands: add-apt-repository and apt-get-update. Both require root access so must be run either from the root console or by using the sudo command.

In case you want to install CUBRID you must add the ppa:cubrid/cubrid repository.

sudo add-apt-repository ppa:cubrid/cubrid
sudo apt-get update

Step 2 – Installing CUBRID

In order to perform the installation after adding the repository, all we need to do is to run apt-get install with root privileges:

a) CUBRID 8.4.1

sudo apt-get install cubrid

a) CUBRID 8.4.0

sudo apt-get install cubrid-8.4.0

c) CUBRID 8.3.1

sudo apt-get install cubrid-8.3.1

CUBRID 8.4.1 installs in the following directories:

  • /opt/cubrid - all the files related to the cubrid execution that cannot be modified;
  • /etc/opt/cubrid - all the configuration files;
  • /var/opt/cubrid - the databases, log files and temporary files;
  • /etc/profile.d/cubrid.sh - script that sets the PATH variables;
  • /etc/init.d/cubrid - service used to start CUBRID on runtime;

Remember: After the installation, you must log off or restart your computer in order for the CUBRID PATH variables to be set.

In case you want to use CUBRID before doing so, 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.

Step 3 (Optional) - Installing The Demo Database

Now that we have installed cubrid, we can install the optional cubrid demodb sample database. You can find the package in the same PPA as the cubrid package. 

If you have installed Cubrid 8.4.1, then you can run the command:

sudo apt-get install cubrid-demodb

This will install the demodb database and start it. In order to connect to the demodb database enter the username "dba" and a blank(empty) password. You can connect to it either from CUBRID Manager (we recommend downloading the archived version and extracting it to /opt/cubrid/cubridmanager) or from CSQL.

Step 4 - Installing PHP API

In case you want to access cubrid databases from within the php code, then you can install the cubrid PHP API using the command below:

 sudo apt-get install php5-cubrid

Other versions: php5-cubrid-8.4.0 (for CUBRID 8.4.0) or php5-cubrid-8.3.1 (for CUBRID 8.3.1).

Step 5 - Uninstall CUBRID

To uninstall cubrid, run  "sudo apt-get remove cubrid", "sudo apt-get remove cubrid-8.4.0" or "sudo apt-get remove cubrid-8.3.1". The same goes for all other installed packages.

The uninstall does not delete the databases located in /var/opt/cubrid/databases. If you want to completely remove the cubrid installation, just remove the folder /opt/cubrid using:

rm -rf /var/opt/cubrid/databases

CUBRID Service

The CUBRID service offers several commands that can be run from the root user or by preceding all commands with "sudo -i" (-i preserves the environment variables).

  • Start Server: service cubrid start
  • Stop Server: service cubrid stop
  • Restart Server: service cubrid stop
  • View Status: service cubrid status (option since CUBRID 8.4.0)

Since CUBRID 8.4.1 the service also supports the following commands:

  • Create Database: service cubrid createdb dbname [parameters] (more details regarding the parameters can be found here: createdb command)
  • Delete Database: service cubrid deletedb dbname (dbname is the name of the database to be deleted)
  • Start Database: service cubrid start dbname
  • Stop Database: service cubrid stop dbname
  • Restart Database: service cubrid restart dbname

Remember: If you encounter the error "cubrid: command not found", then run ". /etc/profile.d/cubrid.sh" to set the PATH variables for CUBRID.

Summary

This concludes the CUBRID Launchpad tutorial. 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/wiki_tutorials/entry/cubrid-tutorials for more tutorials and resources.

Getting Help

If you have any questions, you can post them in our Q&A site or you can post a comment on our forum.




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: