Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

399 Posts in 197 Topics- by 103 Members - Latest Member: AlohaJade

September 03, 2010, 01:27:00 PM
Support ForumAdministrationHow To'sAfreewebhost.com: How to create a MySQL Database in cPanel
Pages: [1]   Go Down
Print
Author Topic: Afreewebhost.com: How to create a MySQL Database in cPanel  (Read 549 times)
0 Members and 1 Guest are viewing this topic.
badkarma
god, root, no difference...
Jr. Member
**

Rep: 5
Offline Offline

Gender: Male
Posts: 89



View Profile WWW
« on: August 02, 2008, 06:56:18 AM »

Afreewebhost.com: How to create a MySQL Database in cPanel

This How-To will deal with something very simple actually. Some scripts you might want to run on your website require a database to store and read information. For example Wordpress, most of the available forum scripts such as vBulletin,Invision Power Board, MyBB and the rest, and pretty much every CMS solution like Drupal,PHP-Fusion,Joomla, and theirlike. So we need to setup a database for those scripts to work properly, rather than just getting an annoying Cannot connect to Database error message which isnīt exactly entertaining and drawing visitors to your site. Agree on that ? Good Smiley

Ok, so how do we setup the Database then ?

Thatīs a fairly simple task, shouldnīt take longer than a minute if you know your way around cPanel and how to get there. To logon to cPanel just point your browser to the
Register or Login
http://afreewebhost.com/clients/
and log in with your details. When logged in you will see the main screen which gives you a lot of options on the left side, such as creating and checking your Support Ticket, viewing your Hosting Details and all that. The screen looks like this

Loads of options on the left side, as i said. So we are logged in alright, now we have to make it to the cPanel. To get there just left-click the My Hosting Packages option which will take you to the next screen, that pretty much looks similar to the one i posted above. The only difference between the two is the the View Details button which is the grey one i highlighted on the screenshot. You canīt really miss it, as itīs the only button there Smiley

Guess what awaits you in the next screen. Right, your hosting details. You are shown several details there, such as date of registration, domain name, billing details and all that. What we, respectively you need is a bit further down. Remember ? We are looking for the cPanel to create that Database. And what do we see on that screen ?

Whoa, there it is. Just one left-click away. So click it, and find yourself being forwarded to the cPanel of your hosting accounts. You will see a lot of options there, donīt be scared. They are all labeled so you exactly know what they do…well that might not be true for all of them but for now we focus on finding the icon relevant for setting up a MySQL Database. How might that be labeled ? Letīs look at the screenshot, think i found it. There are a few other ways to reach cPanel, but for now i am using this one.


Thatīs the option we need to fix us up with a MySQL Database, so letīs go ahead and bravely click that icon to see what happens next on the Crusade for a MySQL Database. The next screen will give you lots of options to have fun with. For now we focus on creating the Database, which isnīt that hard really. The top-most option is called Create Datbase as you can see in the Screenshot below. The options below that, CheckDB and RepairDB are useless right now, as we donīt have a database at all which we could torture with those functions.

The list of your Databases will be empty as well, since you havenīt got any. Now letīs play God for a bit and create something. See where it says New Database: ? Fill in the desired name of your database, then click Create Database right next to it. This will bring up a confirmation screen saying that the Database has been successfully created and all you have to do on that screen is clicking the Go back button to return to the list of installed databases, where the newly created Database now should show up in the list. Letīs go check with the demo database i set up for these tutorials

Yes, there it is. Showing up in the list now. Ok, almost done with it, except…the database is lacking users that are allowed to mess around with it. As opposed to one of my former girlfriends the MySQL database is not kind of usable by everyone, it requires a username and a password to put out…erm…..to allow scripts to store data into it and read from it.

So where do we set up the user accounts ? On the same screen we are still looking at. If you left the screen already, go back there and scroll down. This will bring you to the Create/Add User section, in which we now have to create a user with password and assign that user to the database. Sounds complicated ? Itīs not, trust me. So letīs start out with creating the user.


To do so just come up with a username (maximum of 7 characters) and enter it where it says Username: and a password where it says Password:. When you have done that just left-click the Create User button, and cPanel will create that user, giving you a confirmation screen similar to the one you got when creating the MySQL database and you go back to the overview of your MySQL databases and users. As we have created a new user now the username should now appear in the list of Current Users, letīs check if it does.


Yepp, user was created successfully. Obviously you canīt have two identic usernames, i just was too lazy to create a news text-field in Photoshop and therefore used the original one again hehe. Anyway, the second user has been created successfully, and now all thatīs left to do is assign the user to the database we created earlier. This is to let the database know that the user is allowed to mess around with her. Where to do that ? Look at the screenshot and you will see. We are still in the same screen in which we created the database and the user.

That is where the users are assigned. To do that, just select the username from the dropdown list and assign it to a database from the dropdown list. Then click Add and you are almost done with the last and final step. Having clicked that it will prompt for the rights that the user which is added to the database is given. There is just one option of interest, and that is the ALL PRIVILEGES option.

So tick the ALL PRIVILEGES option and then click Make Changes. Again you will see a confirmation screen telling you that the user has been assigned to the database and upon clicking Go Back it will take you to the screen we have seen a number of times by now, but when looking at the list of databases now, it will show you the database created AND the user belonging to the database.

And thatīs it. We are done with setting up a database to use with scripts we would like to run on the afreewebhost.com account. If you have any further questions you can either ask them here in the comments or post in the Afreewebhost.com Forums, whichever you prefer.

If you found any typos in this tutorial…..keep them. They are yours. And as english isnīt my native language i am sorry if i screw up grammar and stuff sometimes, but i hope it was easy enough to understand. If you have any questions or comments, suggestions or just wanna mock at me then feel free to post here
« Last Edit: August 02, 2008, 07:29:20 AM by badkarma » Logged

With the idea that everyone should have a web presence no matter how old they are, where they live, and what they do, we are offering our service of PHP/MySQL script installation free of charge. Please visit
Register or Login
http://www.free-installations.info
for more information
Pages: [1]   Go Up
Print
Jump to:  

Theme orange-lt created by padexx