Web administrators are often in charge of creating a MySQL database to store relevant data in relation to their websites. Simply put, MySQL is a database technology that makes it easy to organize and manage a group of tables that share a common theme. It could be anything from a basic merchandise list, to a gallery of photos or videos, to large amounts of corporate information.
The problem with most web hosts to date is that they do not allow administrators to directly create a database with a PHP script. This is where the role of MySQL comes in.
Creating your first MySQL database is relatively easy especially if your web host provides a web-based control panel to manage your website. This houses readily available tools to create one and assign a user with specific rights to it. Procedures can vary from host to host, but most of the time, it just involves logging in to the cPanel, naming and saving your database.
Once you have created a database, you can already create users and assign privileges to each. Note that a unique username, which is not more than seven letters long, should be assigned to each user.
Deleting a database is also very simple. You just have to look for and load your current databases, and click the ‘X’ icon next to the one you’d like to remove.
Assigning user rights
User rights define how one is able to access a MySQL database – whether or not he can do basic functions like select, input, update or delete data. As administrator, you can choose to grant only one or all of these privileges. There is also an option to delete users or to make appropriate modifications to their rights to the database.
Proprietary MySQL editions with more flexible functions allow users to execute website administrative operations. The system uses the GRANT command to assign users.
Renaming a database
In case you would like to rename your database, the only way is to export and import it onto a new one with the desired name. You can also duplicate your renamed database by following the same steps. You should be able to do the whole process in thirty seconds as cPanel times out when attempting to import.
Accessing your database
One of the good things about a MySQL database is it can be accessed from your primary server, or your home computer using Remote Server Access which utilizes your home IP. All features are available on remote access, but it is mandatory to have a MySQL client like Dreamweaver, Navicat or phpMyAdmin installed on your PC. Before connecting to the primary server, you must be tagged as Access Host.
Setting up access to a computer that uses static IP address is a one-time thing. However, if your Internet service provider uses a dynamic IP address, it is important that you update your remote settings every time it changes, to ensure that you do not get disconnected and lose access.