<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
    <channel>
        <title>CUBRID Ubuntu Launchpad Installation Tutorial</title>
        <link>http://www.cubrid.org/?mid=launchpad</link>
        <description>CUBRID Ubuntu Launchpad Installation Tutorial</description>
        <language>en</language>
        <pubDate>Thu, 07 Jul 2011 15:24:12 -0800</pubDate>
        <lastBuildDate>Fri, 12 Apr 2013 05:21:43 -0800</lastBuildDate>
        <generator>XpressEngine 1.4.4.1</generator>
                        										        <item>
            <title>CUBRID Ubuntu Lau...</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/launchpad</link>
            <guid isPermaLink="true">http://www.cubrid.org/launchpad</guid>
                                    <description><![CDATA[<h1>CUBRID Ubuntu Launchpad Installation</h1>

<div class="contents-table"></div>

<p>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.</p>

<a name="overview"></a>
<h2>Overview</h2>

<p>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.</p>
<p>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), Ubuntu 12.04 (Precise Pangolin) and <b>Ubuntu 12.10 (Quantal Quetzal)</b>.</p>

<a name="repository"></a>
<h2>Step 1 – Add Repository</h2>

<p>First of all, we must add the repository to the sources list using 2 commands: <b>add-apt-repository</b> and <b>apt-get-update</b>. Both require root access so must be run either from the root console or by using the sudo command.</p>
<p>In case you want to install CUBRID you must add the <b>ppa:cubrid/cubrid</b> repository.</p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false">
sudo add-apt-repository ppa:cubrid/cubrid<br />
sudo apt-get update
</div>
<div><br />
<b>Note</b>: If add-apt-repository command is not recognized by your system, you must install the python-software-properties package.
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false">
sudo apt-get install python-software-properties
</div>
<p>If you encounter strange python errors when running add-apt-repository, reinstall the python-software-properties package as this issue was fixed in the meantime by the Ubuntu community.</p>

<a name="installation"></a>
<h2>Step 2 – Installing CUBRID</h2>

<p>In order to perform the installation after adding the repository, all we need to do is to run <b>apt-get install</b> with root privileges:</p>
<p>a) CUBRID 8.4.3</p>
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="3" collapse="false" nogutter="false" nocontrols="false">
sudo apt-get install cubrid
</div>

<p>a) CUBRID 8.4.0</p>
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="3" collapse="false" nogutter="false" nocontrols="false">
sudo apt-get install cubrid-8.4.0
</div>

<p>c) CUBRID 8.3.1</p>
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="3" collapse="false" nogutter="false" nocontrols="false">
sudo apt-get install cubrid-8.3.1
</div>

<p>CUBRID 8.4.3 installs in the following directories:</p>
<p>
</p>

<ul>
<li>/opt/cubrid - all the files related to the cubrid execution that cannot be modified;</li>
<li>/etc/opt/cubrid - all the configuration files;</li>
<li>/var/opt/cubrid - the databases, log files and temporary files;</li>
<li>/etc/profile.d/cubrid.sh - script that sets the PATH variables;</li>
<li>/etc/init.d/cubrid - service used to start CUBRID on runtime;</li>
</ul>
<p></p>
<p><b>Remember: After the installation, you must log off or restart your computer in order for the CUBRID PATH variables to be set.</b></p>
<p>In case you want to use CUBRID before doing so, every time you open a new terminal window you must type the command:</p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="4" collapse="false" nogutter="false" nocontrols="false">. /etc/profile.d/cubrid.sh</div>

<p>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.</p>

<a name="demodb"></a>
<h2>Step 3 (Optional) - Installing The Demo Database</h2>
<p>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.&nbsp;</p>
<p>If you have installed Cubrid 8.4.3, then you can run the command:</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="5" collapse="false" nogutter="false" nocontrols="false">sudo apt-get install cubrid-demodb</div>

<p>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 <a href="/?mid=downloads&amp;item=cubrid_manager&amp;os=detect" title="Download CUBRID Manager">archived version</a> and extracting it to /opt/cubrid/cubridmanager) or from <a href="/manual/841/en/CSQL%20Startup%20Options" title="csql">CSQL</a>.</p>

<a name="phpapi"></a>
<h2>Installing PHP API</h2>
<p>In case you want to access cubrid databases from within php code, then you can install the cubrid PHP API using the command below:</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="true" nocontrols="false">&nbsp;sudo apt-get install php5-cubrid</div>

<p>Other versions: php5-cubrid-8.4.0 (for CUBRID 8.4.0) or php5-cubrid-8.3.1 (for CUBRID 8.3.1).</p>

<p></p>

<a name="CUBRIDdb"></a>
<h2>Installing CUBRID Python Driver (CUBRIDdb)</h2>
<p>In case you want to access cubrid databases from within python code, then you can install the cubrid Python API using the command below:</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="true" nocontrols="false">&nbsp;sudo apt-get install python-cubriddb</div>

<a name="cwm"></a>
<h2>Installing CUBRID Web Manager</h2><p>Since CUBRID 8.4.3, CUBRID Web Manager is installed when you install the cubrid package. Just start up the server using:</p>
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" collapse="false" nogutter="false" nocontrols="false">sudo service cubrid start</div>
<p>To check if the connection is succesful, you can browse https://localhost:8282 to log in the web manager console.</p>

<a name="uninstall"></a>
<h2>Uninstall CUBRID</h2>
To uninstall cubrid, run&nbsp;
"sudo apt-get remove cubrid",&nbsp;"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.

<p>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:</p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false">
rm -rf /var/opt/cubrid/databases
</div>

<h2>CUBRID commands</h2>
<div>CUBRID is set to autostart on boot. If you want to stop/start or perform other administrative commands such as loaddb/unloaddb, then you must connect as cubrid user using the command:</div>
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false">
sudo su -s $SHELL cubrid
</div>
<div><br /></div>
<div>This command will open up the terminal for user cubrid in which you can run every command you require. The only requirement you need to pay attention to is that "cubrid" user must have access to the files you want it to use.&nbsp;</div>

<div><br /></div>

<div>For example, when running "cubrid loaddb", the files given as parameters must be in a folder that the "cubrid" user can access and it should have permission to read the files.</div>

<div><br /></div>

<div><b>Note: </b>All the basic CUBRID commands can be ran without connecting as "cubrid" user by using the service described in the following section.</div>

<a name="service"></a>
<h2>CUBRID Service</h2>
<p>The CUBRID service offers several commands that can be run from the root user or by preceding all commands with sudo.</p>
<p>
</p>

<ul>
<li>Start Server: service cubrid start</li>
<li>Stop Server: service cubrid stop</li>
<li>Restart Server: service cubrid restart</li>
<li>View Status: service cubrid status (option since CUBRID 8.4.0)</li>
</ul>
<p></p>
<p>Since CUBRID 8.4.1 the service also supports the following commands:</p>
<ul>
<li>Create Database: service cubrid createdb dbname [parameters] (more details regarding the parameters can be found here: <a href="/manual/841/en/Database%20Administration-Creating%20Database" title="createdb">createdb command</a>)</li>
<li>Delete Database: service cubrid deletedb dbname (dbname is the name of the database to be deleted)</li>
<li>Start Database: service cubrid start dbname</li>
<li>Stop Database: service cubrid stop dbname</li>
<li>Restart Database: service cubrid restart dbname</li>
</ul>


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

<p><b>Important! </b>The output of the last service command ran is saved to <b>/var/opt/cubrid/tmp/service.cubrid</b>. If you encounter the message <b>[fail] </b>when running a service command, check the output to see the reason the command failed. If you encounter any problems solving the issue, please check out the <b>Getting Help</b> section below and post a question including the output of the command.</p>

<a name="summary"></a>
<h2>Summary</h2>

<p>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&nbsp;<a href="/wiki_tutorials/entry/cubrid-tutorials" target="_self">http://www.cubrid.org/wiki_tutorials/entry/cubrid-tutorials</a> for more tutorials and resources.</p>

<a name="help"></a>
<h2>Getting Help</h2>

<p>If you have any questions, you can post them in our <a href="/questions" target="_self">Q&amp;A site</a> or you can post a comment on our <a href="/forum" target="_self">forum</a>.</p>

</div>]]></description>
                        <pubDate>Tue, 14 Feb 2012 04:12:02 -0800</pubDate>
                        <category>ubuntu</category>
                        <category>launchpad</category>
                        <category>cubrid</category>
                        <category>install</category>
                        <category>8.3.1</category>
                        <category>8.4.0</category>
                        <category>8.4.1</category>
                        <category>8.4.3</category>
                                </item>
            </channel>
</rss>
