<?xml version="1.0" encoding="UTF-8"?><rss version="2.0">
<channel>
<title>MySQL</title>
<link>http://www.computersight.com/tags/MySQL</link>
<description>New posts about MySQL</description>
<item>
<title>How To: Set Up a Linux Based Server Using Ubuntu</title>
<link>http://www.computersight.com/Operating-Systems/Ubuntu/How-To-Set-Up-a-Linux-Based-Server-Using-Ubuntu.389931</link>
<description>
<![CDATA[<p>If you use this tutorial, you will not have to pay someone else for website hosting. However, you will still have to purchase a domain name (.com, .net, .org, or a different Top-Level Domain). You will also have to have your own connection to the internet, with a static IP. This article does NOT cover setting up the port forwarding on your router if you have one, just the set up of the actual server.</p>
<h3>Getting Ready</h3>
<p>First off, you will need a computer that you do not use for anything else, including surfing the Internet. If you do not have one, you can purchase any brand name computer, or, if you prefer, build one your self. You will also need a broadband internet connection, preferably with a high upload speed.</p>
<p>If you do not have a static IP, or if you do not know if you have a static IP, call your Internet provider. Make sure you write down the static IP, as you will need it later.</p>
<p>You will need to download Ubuntu from the Ubuntu website, and burn it to a CD. This is not the same as burning a music or general data CD. You will want to use your burning program's "Burn from image" feature (the image is a .iso image). If your burning program does not have this feature, you can usually find freeware that does. Make DOUBLE sure that&amp;nbsp; you download the SERVER EDITION of Ubuntu.</p>
<h3>Installing Ubuntu</h3>
<p>Insert the CD you burned into your CD-ROM or DVD drive, and boot your computer. Some computers will automatically boot from the CD so you can install. For the computers that do not automatically boot from the CD, there will usually be a screen that comes up saying something along the lines of "Press any key to boot from CD or DVD...". This usually gives you a limited amount of time to press any key. Press any key and it will boot from the CD.</p>
<p>After you have booted from the CD, choose the install option. This is a fairly easy step-by-step process. One of the screens will ask you what type of server you wish to install. Choose HTTP or LAMP server (LAMP stands for "<strong>L</strong>inux, <strong>A</strong>pache, <strong>M</strong>ySQL, <strong>P</strong>HP server"). After the installation is finished, it will ask you to remove the CD or DVD and restart the computer.</p>
<h3>Setting Everything Up</h3>
<p>After you have rebooted your computer, you will notice that the operating system successfully installed, but there is no user interface, just a command prombt-like interface. This is called the "Linux Terminal". Ubuntu Server Edition does not come with a desktop interface installed by default. First, type in your user name and password that you created during installation.</p>
<p>If you are not experienced with the Linux Terminal, you may want to install a desktop evironment. To install the Gnome Desktop environment, type the following into the Terminal:</p>
<blockquote>
<p>$ sudo su</p>
<p>[The password you created durring installation]</p>
<p>$ apt-get install gnome-desktop</p>
</blockquote>
<p>Or, if you perfer the KDE Desktop evironment, type the following:</p>
<blockquote>
<p>$ sudo su</p>
<p>[The password you created during the installation]</p>
<p>$ apt-get install kde-desktop</p>
</blockquote>
<p>Please keep in mind that you do NOT type the $ symbols when typing commands. Those are there to let readers of this article know that it is a new command.</p>
<p>After the desktop environment has finished installing, you server is ready to use. The directory you will put your website in is the '/var/www' directory. This can be changed, but changing it involves editing the Apache configuration files. I do not recommend doing this if you are not familiar with those files. I will do another tutorial next week on how to use WordPress with this type of Ubuntu installation.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FOperating-Systems%2FUbuntu%2FHow-To-Set-Up-a-Linux-Based-Server-Using-Ubuntu.389931"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FOperating-Systems%2FUbuntu%2FHow-To-Set-Up-a-Linux-Based-Server-Using-Ubuntu.389931" border="0"/></a>]]></description>
<pubDate>Wed, 10 Dec 2008 06:22:24 PST</pubDate></item>
<item>
<title>What is PHP? Learn the Basics</title>
<link>http://www.computersight.com/Programming/PHP/What-is-PHP-Learn-the-Basics.329203</link>
<description>
<![CDATA[<p>You might have seen a lot of website having tail ".php". Basically these are PHP websites. You might have been quiet impressed by the site design and dynamic qualities of these websites. You can too create websites like these in a matter of hours. But first you need to know what on earth PHP is.</p>
<p>In the world of the wide web, there are two general types of coding languages: &amp;ldquo;Server side&amp;rdquo; and &amp;ldquo;Client side&amp;rdquo;.</p>
<p>This means that one type is run, or interpreted, on the web server itself, and the other is run in your web browser. PHP is a Server side language. All of the processing is done on the web server itself, and the result is delivered to your web browser as HTML (which, by the way, is a Client side language). Your web server must also have PHP installed in order for it to work! Most web hosting providers have PHP installed, so if you are in doubt, simply ask them.</p>
<p>But testing PHP websites is quite a hectic work. You need to have PHP installed in your system. You also need to install a server like Apache. But good news is both are free and open source. You can download them and install from their respective website. (Packages from other websites may not be reliable).</p>
<p><img src="http://images.stanzapub.com/readers/2008/11/03/0_13.jpg" alt="" /></p>
<p>I am assuming that you have already installed the Apache Server in your system.</p>
<p>Run the MSI installer and follow the instructions provided by the installation wizard. You will be prompted to select the Web Server you wish to configure first, along with any configuration details needed.</p>
<p>You will then be prompted to select which features and extensions you wish to install and enable. By selecting "Will be installed on local hard drive" in the drop-down menu for each item you can trigger whether to install the feature or not</p>
<p><img src="http://images.stanzapub.com/readers/2008/11/03/1_6.jpg" alt="" /></p>
<p>It is not recommended to install all extensions by default. Instead, use the Installation Repair Mode that can be triggered thru the "Add/Remove Programs" control panel to enable or disable extensions and features after installation.</p>
<p>After you install PHP You need to test it. Open the "Note Pad" and write the following code:</p>
<p>phpinfo();</p>
<p>?&amp;gt;</p>
<p>Save this file in "htdocs" of your server as phpinfo.php.</p>
<p>Now open your favorite browser and type: localhost/phpinfo.php</p>
<p>A long page will be displayed with all the PHP description. If the page doesn't comes then check your PHP installation.</p>
<p><img src="http://images.stanzapub.com/readers/2008/11/03/435023_2.jpg" alt="" /></p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FPHP%2FWhat-is-PHP-Learn-the-Basics.329203"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FPHP%2FWhat-is-PHP-Learn-the-Basics.329203" border="0"/></a>]]></description>
<pubDate>Tue, 04 Nov 2008 04:52:40 PST</pubDate></item>
<item>
<title>Mac OS X: A Web Developer's Dream</title>
<link>http://www.computersight.com/Operating-Systems/Mac-OS/Mac-OS-X-A-Web-Developers-Dream.186115</link>
<description>
<![CDATA[<p>Web developers often shy away from Mac OS X, because they believe that it is very unsuitable in terms of web development; this is very untrue, and in this article I will talk about Mac OS X and web development, sorting out truth from fiction.</p>
<h3>Myth #1</h3>
<p>You can't do any real web development on Mac OS X, including server scripts such as PHP.</p>
<h4>The Truth</h4>
<p>You can do the same amount of web development on Mac OS X as you can on any Windows machine; in fact, I have found Mac OS X even easier to set up server scripts. Recently I decided to set up PHP on my Mac at home to find out that Mac OS X Leopard actually comes with Apache2 and PHP5 already installed onto it! All it takes is a few configuration steps to set up PHP5 to work on your computer.</p>
<h3>Myth #2</h3>
<p>It is much harder to set up the use of web development languages on Mac OS X than it is on Windows.</p>
<h4>The Truth</h4>
<p>I have actually found it easier to set up different web development languages on my Mac than on my friends Windows computer. A few days after I set up Apache2, PHP5 and MySQL on my Mac I helped a friend do it on his Windows computer. It took at least 3 more hours to get all of them installed on his computer than on mine, and even longer to get MySQL to work because the default configuration file for MySQL on Windows does not have everything needed for it to work.</p>
<h3>Myth #3</h3>
<p>You might be able to do web development on Mac, but you can't get much further than the things you can do with iWeb.</p>
<h4>The Truth</h4>
<p>You can do the same scripting on a Mac as you can do on a Windows machine. Saying that you are confined to iWeb is like saying you are confined to Frontpage on Windows.</p>
<p>There are many more myths regarding Mac OS X and web development, but I think that this will help some of you realize that Mac OS X is just as good for web development as Windows is. In the end, the scripting of languages is the same on both machines because the languages do not change depending on operating systems; the only difference I can find is setting up those scripting languages, which I have found to be much easier on Mac OS X than on Windows.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FOperating-Systems%2FMac-OS%2FMac-OS-X-A-Web-Developers-Dream.186115"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FOperating-Systems%2FMac-OS%2FMac-OS-X-A-Web-Developers-Dream.186115" border="0"/></a>]]></description>
<pubDate>Mon, 28 Jul 2008 06:16:49 PST</pubDate></item>
<item>
<title>PHP Tutorial: Printing on the Screen</title>
<link>http://www.computersight.com/Programming/PHP/PHP-Tutorial-Printing-on-the-Screen.112786</link>
<description>
<![CDATA[<p>PHP is a script language commonly used by webmasters to design dynamic websites. Unlike HTML which has static content, PHP has dynamic content because of user interaction. Today, most of the qualified websites are designed by PHP or CGI.</p>
 
<p>PHP scripts embedded into the HTML codes. When someone checks the source code of the page, he doesn't get anything about PHP scripts. He only learns the HTML part of coding. This article is an introduction to PHP scripting language. One can find useful information and have enough knowledge after reading my PHP tutorial series. Without delay, I would like to start my script creation step by step.</p>
 
<p>Before starting, you should know that you have to set up PHP installations into your computer. Such installations are PHP itself, Phpmyadmin interface, Mysql database and Apache Server. Without these, your scripts are nothing since they are not compiled by your computer.</p>
 
<h3>Step 1:</h3>
 
<p>To write PHP scripts, we need a place. That place is a simple text editor. You are free to choose your text editor. I prefer  to use Notepad. There are other alternatives like Editplus or Elfima. If your operating system is not Windows but Linux, you can place your code into Vi editor or Pico. I have never tried but I think you can use Dreamveawer, Hotdog or Frontpage.</p>
 
<p>In your text editor, open an new file and save it as &amp;ldquo;myfirst.php&amp;rdquo; or &amp;ldquo;myfirst.html&amp;rdquo; . I choose the name of file as &amp;ldquo;myfirst&amp;rdquo; but you are free to choose anything.</p>
 
<h3>Step 2:</h3>
 
<p>I have told you before that PHP scripts are embedded into HTML codes. So, first of all we will write HTML codes. The basic codes are HTML, TITLE, HEAD and BODY. It can be written by lowercase letters as well. This part is not important.</p>
 
<p><img src="http://images.stanzapub.com/readers/computersight/2008/04/22/149028_0.jpg" alt="" /></p>
 
<p><strong>Step 3: </strong>All PHP scripts start with &amp;ldquo;  &amp;rdquo;. Only the part between two  is compiled by server and evaluated as output.To print characters on the screen, standart output functions of PHP are used. Those are &amp;ldquo; print &amp;rdquo; and &amp;ldquo; echo &amp;rdquo;. In some circumstances, &amp;rdquo; printf &amp;rdquo; is used too.</p>
 
<p>The format of printing:</p>
 <ol> 
<li> print  ( &amp;ldquo; your output &amp;rdquo; ) ;</li>
 
<li> print   &amp;ldquo; your output &amp;rdquo;  ;</li>
 
<li> echo &amp;ldquo; your output &amp;rdquo;  ;</li>
 
<li> echo ( &amp;ldquo; your outpu t&amp;rdquo; ) ; </li>
 </ol> 
<p>If you don't use any white space characters, the strings are written without any separation. For example if you write this code;</p>
 
<ul>
<li>Print ( &amp;ldquo; Word1 &amp;rdquo; ) ;</li>
 
<li>Print ( &amp;ldquo; Word2 &amp;rdquo; ) ;</li>
 
</ul>
<p>It will be outputted as Word1Word2.</p>
 
<p>To remove this fault,white space characters are used. In PHP code part, between print functions, we place &amp;lt; br &amp;gt; code.</p>
 
<p>Example: To be more understandable,I will write a simple PHP script. Output will be the name of my favorite Triond writers.</p>
 
<p><img src="http://images.stanzapub.com/readers/computersight/2008/04/22/149028_1.jpg" alt="" /></p>
 
<p>To see the output,<a href="http://learnphp.awardspace.biz/" target="_blank"> Click here.</a></p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FPHP%2FPHP-Tutorial-Printing-on-the-Screen.112786"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FPHP%2FPHP-Tutorial-Printing-on-the-Screen.112786" border="0"/></a>]]></description>
<pubDate>Tue, 22 Apr 2008 06:42:32 PST</pubDate></item>
<item>
<title>How to Install Mondrian - The Complete Guide</title>
<link>http://www.computersight.com/Software/How-to-Install-Mondrian---The-Complete-Guide.88305</link>
<description>
<![CDATA[<p>As a programmer, when I encounter a tool like Mondrian I want to cry with joy. I want to sing (actually this is what I do) and dance from happiness. The reason is, it saves me a lot of time and frustration programming it by myself.</p>
<p>With Mondrian, all you have to do is describe what do you want to see and how and it will make the hard work for you.</p>
<p><a href="http://mondrian.pentaho.org/" target="_blank">Mondrian</a> is an open source OLAP server which was developed by Pentaho and is free to use. All you need to do is download and install, learn how to use it and start rocking. The only problem is that installing Mondrian is a very, very unintuitive, frustrating task that is not well documented. You need to be very stubborn to succeed. The  <a href="http://mondrian.pentaho.org/documentation/installation.php" target="_blank">installation guide</a> that Pentao provides does not reveal the whole picture and I had to hunt for information all over the web until I slowly managed to install it, hence I wrote this guide to shed some light on the task.</p>
<p>Two things before we start:</p>
<ul>
<li>I assume that you have already installed and are using mysql (otherwise why would you need OLAP for?) but in case you haven't, download and install  <a href="http://dev.mysql.com/downloads/mysql/5.0.html#downloads" target="_blank">Mysql</a> </li>
<li>I use Linux so i will write my examples for Linux.</li>
</ul>
<p>OK, Lets start:</p>
<ol>
<li>
<p>Mondrian was written in Java. If you don't have Java, download  <a href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">JDK</a> and install it.</p>
<p>I have downloaded the RPM file. The command is : rpm -ivh rpm-file-name</p>
</li>
<li>
<p>Download  <a href="http://tomcat.apache.org/download-55.cgi" target="_blank">Tomcat</a> and  Install tomcat.</p>
<p>I have downloaded the tar.gz file. the command is:   tar -xzvf tar.gz-file</p>
</li>
<li> Move Tomcat under /usr/local/tomcat</li>
<li> Go to /usr/local/tomcat/bin. There you can find the files for activating and deactivating tomcat:  
<ul>
<li>./startup.sh - activates</li>
<li>./shutdown.sh - dactivates</li>
</ul>
<p>Run the ./startup.sh to activate tomcat.</p>
</li>
<li> Download  <a href="http://dev.mysql.com/downloads/connector/j/3.1.html" target="_blank">Mysql JDBC driver</a> and unzip it.</li>
<li> Verify that so far all installations were successful  
<ul>
<li>Test java : java - version</li>
<li>Test mysql : mysql -V</li>
<li> Test tomcat : If the ./startup.sh command went well you can go to the browser and type http://localhost:8080 and you will be able to see the tomcat welcome page which look like this : </li>
</ul>
</li>
<img src="http://images.stanzapub.com/readers/computersight/2008/02/29/119762_0.jpg" alt="" />
<li> Download the  <a href="http://sourceforge.net/search/?words=mondrian&amp;amp;sort=release_date&amp;amp;sortdir=desc&amp;amp;offset=0&amp;amp;group_id=35302&amp;amp;type_of_search=files&amp;amp;pmode=0" target="_blank">last version of Mondrian</a> and unzip it to /usr/local/mondrian. The result will be a new directory containing all Mondrian files. the name of directory will be mondrian-x.y.z.</li>
<li>
<p>Create mondrian directory under /usr/local/tomcat/webapps/ and move mondrian.war to there.</p>
<p>The result will look like this : /usr/local/tomcat/webapps/mondrian/mondrian.war</p>
</li>
<li>
<p>Explode mondrian.war</p>
<p>command : jar -xvf mondrian.war</p>
</li>
<li> Move the JDBC connector jar file mysql-connector-java-[ver]-bin.jar under /usr/local/tomcat/webapps/mondrian/WEB-INF/lib</li>
<li>
<p>The next step will be to create the FoodMart mysql database for the example application.</p>
<p>use this commands:</p>
<ul>
<li>shell&amp;gt; mysql</li>
<li>mysql&amp;gt; create database foodmart;</li>
<li>mysql&amp;gt; create user "foodmart"@'yourhost' identified by "foodmart";</li>
<li>mysql&amp;gt; grant all privileges on *.* to "foodmart"@'yourhost' identified by "foodmart";</li>
</ul>
</li>
<li>
<p>Now, run the FoodMartLoader application to load the Foodmart database with data. It is important to pass the full path to all jar files and remove all spaces from the class path. Otherwise it fails for ClassNotFound or all kind of other errors.</p>
<p>command should look like this:</p>
<p>java -cp "/usr/local/tomcat/webapps/mondrian/WEB-INF/lib/mondrian.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/log4j-1.2.9.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/eigenbase-xom.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/eigenbase-resgen.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/eigenbase-properties.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar" mondrian.test.loader.MondrianFoodMartLoader -verbose -tables -data -indexes -jdbcDrivers=com.mysql.jdbc.Driver -inputFile=/usr/local/mondrian/demo/FoodMartCreateData.sql -outputJdbcURL="jdbc:mysql://localhost/foodmart?user=foodmart&amp;amp;password=foodmart"</p>
</li>
<li> Copy xalan.jar to tomcat/common/endorsed.
<p><span>command : cp /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/xalan.jar /usr/local/tomcat/common/endorsed</span></p>
</li>
<li> Go to /usr/local/tomcat/webapps/mondrian/WEB-INF and modify web.xml and datasources.xml files as appropriate. The driver value should be : JdbcDrivers=com.mysql.jdbc.Driver</li>
<li> Go to /usr/local/tomcat/webapps/mondrian/WEB-INF/queries and modify all query files connect strings as appropriate.</li>
<li> export CATALINA_OPTS='-Djava.awt.headless=true' or add to your shell profile, this stops tomcat dying when X-windows is not found.</li>
</ol>
<p>Congratulations. Now you are ready to run mondrian.   Point your browser to : http://localhost:8080/mondrian and you will get this screen:<img src="http://images.stanzapub.com/readers/computersight/2008/02/29/119762_1.jpg" alt="" /></p>
<p>I hope that this guide will make life easier for you. I also want to give credit to this  <a href="http://blog.vmdatamine.com/2007/09/mondrian-olap-on-mysql-ec2-part-1.html" target="_blank">blog</a> which helped me a lot.</p>
<p>Here are some useful links which can help you start learning this world:</p>
<ul>
<li> <a href="http://www.databasejournal.com/features/mssql/article.php/10894_1495511_2" target="_blank">MDX</a> </li>
<li> <a href="http://mondrian.pentaho.org/documentation/schema.php" target="_blank">Writing a schema</a> </li>
</ul>
<p>Good luck and enjoy the Mondrian magic.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FSoftware%2FHow-to-Install-Mondrian---The-Complete-Guide.88305"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FSoftware%2FHow-to-Install-Mondrian---The-Complete-Guide.88305" border="0"/></a>]]></description>
<pubDate>Fri, 29 Feb 2008 11:14:28 PST</pubDate></item>
</channel>
</rss>
