An Introduction To MySQL Databases

January 9th, 2008

MySQL.comAs today’s web applications mostly all require a database end, it is crucial to understand the basics if you want to run your own website. If you’re unfamiliar with databases, I suggest you read Which Database Server To Choose. While it’s not really an introduction to databases, it’ll give you a good idea.

If you don’t currently have a web host, header over to our list of web hosting plan that include a MySQL database.

Creating A Database

While it’s possible to create your database through a command line, chances are you’ve got a control panel through which you can achieve this task. Today I’m gonna show you how to do this with cPanel but as long as you get the idea, you’ll be able to do it through any control panel.

Now simply head over to your cPanel control panel and click on the MySQL Databases icon.

cpanelmysql.jpg

In the New Database text box, enter the name you want for your database and hit Create Database.

That’s it, you database has been created!

Adding Users To Your Database

Now that you’ve got your database, you must add user rights to it. If you’re using cPanel, your control panel account name is probably giving you full access to all of your database. While this may be convenient for administration purposes, it is not a good idea to use this account in your scripts for performance and security reasons.

Using read-only MySQL accounts in your website’s script will increase performance.

Specify a username and password for the newly created database in the Current Users section. Once you’ve added a user account, you must associate it with your database. In the Add Users To Your Databases section, select the user you’ve created as well as the database name from the drop down lists. Click on the Add User To Database button.

Allowing Remote Connection

At this point, you will only be able to query your database from the webserver itself. If you need to access it remotely, you’ll need to specify from which host(s) you will connect.

Usages for allowing remote connection include using third-party report softwares, database management interfaces, ODBC connection, etc.

So if you want to give access to a remote host, simply enter its IP address or its hostname to the Access Hosts list.

That’s pretty much it, now you can use phpMyAdmin to manage your database online. If you’re using cPanel, follow the phpMyAdmin link at the bottom of the MySQL page.

0 responses so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment




Webmaster Resources: Web Hosting Blog
© Copyright 2012 - TheWebHostingHero.com
Follow us on TwitterFacebookSubscribe to our RSS Feed