The answer to your question is yes, yes and no. In this tutorial, I will teach you how to easily set up your very own server with a database on it. After installing your server and database, you can use it for all sorts of things. You can experiment with it and learn all the ins and outs to data storage. Or you can use it to save you money. You can use your database to store your application's data instead of paying to use some other person's database. So no, this tutorial does not show you how to set up "just a database", it shows you have to take your projects to a whole new level and save you money at the same time.
-1 Old Desktop Computer, do not use a laptop, they are not made to stay on for long periods of time. As long as your computer is newer than 1995, it should have plenty of computing power for this task.
-Ubuntu Server, you can obtain this free software here: http://www.ubuntu.com/download/server
-ISO Burner, a free ISO Image Buner can be obtained here: http://www.freeisoburner.com/
-1 Blank CD or DVD
-Time, I would set aside an afternoon to complete these steps. This whole process should only take about an hour, maybe even less. But once you get your server and database up and running you are going to be hooked. So definitely clear you schedule and set aside the whole afternoon for this project.
Steps to take before beginning:
1. Create a Back-up, keep in mind that you will be wiping your desktop computer clean. Once you install Ubuntu Server , everything that was on the computer is destroyed and CANNOT be retrieved. That being said, if you wish to keep any of the contents on the computer, create a back up of it so you do not loose it.
2. Create Boot CD, use the ISO Burner and the Ubuntu Server ISO image that you downloaded above to create the CD.
Step 1: Boot Computer From Disk
Notes: Your computer should automatically boot from the CD if there is a CD in the disk drive when the computer is turned on. If your computer does not automatically boot from the CD try the following steps:
-Hit F2 while your computer is booting. If F2 does not work, try rebooting your computer and watch for a message similar to "Hit ___ to enter Setup" , you are going to want to hit that key. By the time you have realized what key to hit, it may be too late to hit that key. That is no problem, just restart your computer one more time. But this time be ready to press that key!
-Navigate to the Bioas Tab.
-Change the boot order so that CD-Rom is the first one on the list.
-If you are still having problems booting your computer from a CD, try this link below:
Step 2: Select a Language
Note: This is not the language that will be used during installation or the language that will be used as the default language for your server. You will choose that language two steps from now. This selection is simply the language the next screen will be displayed in.
Step 3: Begin the Installation Process
Note: Before hitting enter ensure you are highlighting the "Install Ubuntu Server" option. Also, there are several options that we need to configure before the installation occurs, so you still have time to change your mind before erasing the current OS on your computer and replacing it with Ubuntu Server. Do not feel like this is your last chance to stop, because you still have plenty of time to change your mind!
Step 4: Select Default Language
Note: This will be the language used during installation and used as the default language of your server. Once Ubuntu Server is completely installed, you may choose to change the default language if you wish. This is not an end all be all decision!
Step 5: Select a Location
Note: This only uses your answer to set the time zone. It does not release your location anywhere or to anyone. So do not worry about your exact location be broadcasted to the world because this will NOT happen.
Step 6: Step _: Select Keyboard Settings
Note: If you are using a regular American keyboard, selecting "no" and choosing "English (US)" on the next screen is your fastest and easiest option. The only reason you would choose "yes" is if you are using some sort of custom keyboard.
Step 7: Choose a Hostname
Note: This hostname will only be seen by others that are connected to the same network as your server. So get as crazy as you would like if you are the only person using your network! I like to keep mine simple and easy, so I use the name userver, for Ubuntu Server. But please feel free to pick any name you would like!
Step 8: Choose Name
Note: This is the name that your system will identify as the administrator. This name will only be shared with others if you give your server permission to do so. Therefore it is safe to use your full name without being worried about your personal information being released. I always use my real name, but if you do not feel comfortable using your real name, you may use any alias you wish!
Step 9: Choose a Username
Note: The username you provide here will have root permissions and will replace the root user. Think of this username as the president of a country and every other username you create will be a citizen. The president has a lot of power while the citizens do not have quite as much.
WARNING: It is VERY DIFFICULT to recover this username if you forget it. It may be a good idea to write down this username and keep this username somewhere safe just in case you do happen to forget it.
Step 10: Choose Password
Note: This is the password that will be used with the previous username that you entered. If you have this password, you have access to everything and anything on your server. Think of this password as being the highest level of security clearance, once you have it you can see everything! So if you plan to keep sensitive information on this server please choose a safe password. A really good way to create a safe password is to include a few punctuation marks in it.
WARNING: It is VERY DIFFICULT to recover this password if you forget it. It may be a good idea to write down this password and keep this username somewhere safe just in case you do happen to forget it.
Step 11: Select Encryption
Note: If you plan to store sensitive information or are unsure of whether or not sensitive information will be kept on this server, I would highly recommend selecting yes for this step. If you know for certain you will not keep sensitive information on this server, it is safe to select no for this step. If the most sensitive information on your server is going to be an electronic copy of your sisters diary, then I do not think there is any need for you to encrypt your home directory. Unless your sister is an expert computer hacker...then you are in trouble either way!
WARNING: Selecting yes and encrypting your home directory does NOT gaurantee that, if stolen, your sensitive information cannot be accessed. But this step will ensure that the average thief will not be able to access your sensitive information.
Step 12: Step _: Confirm Time Zone
Note: Once you have finished installing Ubuntu Server you may change the time zone at any time. So if you make a mistake here, you can correct it later!
Step 13: Select Partition Method
Note: I used the "Guided - use entire disk" option because I wanted to dedicate my entire disk to the server but if you only want to dedicate part of your disk to the server then go ahead and choose a different option. I would recommend that you partition your entire disk to your server unless you know exactly what your are doing when working with partitions.
Step 14: Select Disk to Partition
Note: Most of the time there will only be one disk to select from during this step. If there is more than one option to choose from, I would recommend selecting the default disk (the disk that was highlighted when this prompt appeared).
WARNING: This is your LAST chance to change your mind. After you hit "Enter", Ubuntu Server will begin installing on the selected disk. Everything that was one your disk will be permanently erased. DO NOT HIT ENTER IF YOU DO NOT WANT THE CONTENTS OF YOUR DISK ERASED!
Step 15: Relax
Note: The initial installation process has begun and can take a while to complete. It may take anywhere from just a few minutes to 45 minutes. At some points it may appear as though the installation has frozen. Do not worry, the installation has not frozen unless it has been stuck on the same step for more than 20 minutes. While you wait, go ahead sit back, kick you feet up and relax.
Step 16: Select Additional Software
Note: To select an item click the SPACE bar, do not hit ENTER. Hitting enter before the space bar will not select any items to install. Once the box ([ ]) next to the item(s) that you want to install is filled with a star (*), you may hit enter. The goal of this tutorial is to set up a server with a database on it and that is why we have selected LAMP server. LAMP stands for Linux, Apache, MySQL, and PHP. These are the four items needed for a database.
-Linux is the OS that the database is located on.
-Apache allows users to communicate with the server through http requests.
-MySQL is the database itself.
-PHP retrieves data from the database upon an http request.
If you want to learn more about what each of these four items are, I would recommend visiting w3schools.com! But for the sake of this tutorial, just know the a LAMP server is the type of server you need if you want to host a database on your server.
Step 17: Relax ... Again
Note: This should be a much faster installation than the last one. I am sorry, but you probably do not have time for that second cat nap right now. This step should only take, at most, 5 minutes! That is plenty of time to grab a quick snack though!
Step 18: Select Password
Note: Be sure to use a strong password if you plan to keep sensitive information in this database. It is also a good idea to use a different password than the one you used earlier in the installation. This way a thief needs to obtain two different passwords to access your database. I know two different passwords is not easy to remember. But think of it in terms of this situation: an intruder is trying to break into your house and steal your valuables. Would you rather have that intruder just have to get through a window to get your valuables or would you rather that intruder have to climb through a window and avoid several watch dogs?
WARNING: It is VERY DIFFICULT to recover your password if forgotten. It may be a good idea to write down your password and keep it somewhere safe.
Step 19: Step _: Celebrate!
Go ahead and give yourself a pat on the back! You have just completed installing your first Ubuntu Server. Now the real fun can begin!
Step 20: Login and Enjoy
Now that you have completed installing your Ubuntu Server you may be wondering what to do next. Here are a few suggestions on how to continue:
-Visit w3schools.com, they have great resources for learning MySQL
-Visit http://www.tutorialspoint.com/mysql/, more tutorials to help you learn MySQL
-Visit https://help.ubuntu.com/12.04/serverguide/index.html, contains a plethora of information about Ubuntu Server
-Visit no-ip.com, here you can obtain a free domain name for your server