LogoWebHost.com
  meeting all your web needs: hosting, logo and design
home | about us | contact us   
home hosting plans reseller plans web design testimonials faq support contact us  
FAQ C-PANEL

FAQ


E-MAIL HELP


WEBMAIL HELP



Do you have a manual for your control panel?

Yes, a manual for cPanel is available. Go here to view it.

How do I create a MySQL database, a user, and then delete if needed?


Create: If you are using any type of PHP software or keeping a collection of records which need to be accessed in some way, you will need to create a database. Below will show you how to create a MySQL database in cpanel.

  1. Click the MySQL Databases icon
  2. In the box to the right of New Database, please provide a name for the database. Please note cPanel will create the full name of the database as cpaneluser_databasename
  3. Click the Create Database button

You have now successfully add the database, You will now need to crate a user to access the database.

Create User: Whenever you have any type of MySQL database, you will need to assign a user to be able to access the database. If you would like to create a user and give them access to the database, please do the following:

  1. Click MySQL Databases
  2. Scroll down until you see the Current Users section
  3. Under this section and to the right of User name, please provide a user name for a database
  4. Please note that that full database user will be cpaneluser_databaseuser
  5. To the right of Password, please type the password for which you would like to create for this database user.
  6. Click Create User

You have now created a database user. You can manage it from PhpMyAdmin, found in the Databases section in cPanel.

You now need to give the user privileges for your specified database.

  1. In the drop down menu to the right of User, please sect the user for which you would like give privileges to.
  2. To the right of Database, please select a database for which you would like the user to have privileges to.
  3. Under privileges please choose what type of privileges you would like the user to have.
  4. Click Add User To Database button You have now created a new database with a privileged user. You can now input the information into a php script or another script to access it locally

You have now just gave a user permissions to a database.

Delete: If you are deleting a script or would like to restart a new database, the first step is to delete the old MySQL database. To do so, please do the following:

  1. Click MySQL Databases
  2. Under Current Databases, you will find the names of all your current databases.
  3. Click Delete next to the name of the database you would like to delete.

You have now deleted a MySQL Database.

Note: You may also need to delete the user who is accessing the database as well, if you would like not to have any further traces of the that database lingering.


How to import your MySQL database

How can I import a database?

  1. Go to phpMyAdmin
  2. Click the new database name in the top left (optional)
  3. Click Import in the main area of phpMyAdmin
  4. Browse for the .sql file on your computer and click Go

The optional step depends on if the new database name exists. If yes, then go ahead and click it. If no, skip it. If you get an error, refer top the list below.

Common Issues

Your import file is too large!
You will know this is the case when phpMyAdmin times out. (It will timeout after 30 seconds of attempting to import.) Simply email support@hostgator.com with the import file attached. Our administrators will import the database for you.

#1044 - Access denied for user 'username1'@'localhost' to database 'user2_wrdp9'
The problem here is your import file contains an SQL query that attempts to create a database for the wrong username. Notice the user2 in 'user2_wrdp9' does not match the username1 in 'username1'@'localhost'. Someone must edit the import file and change the old user2 to your new username1. (If you do not feel comfortable editing your import file, we will be glad to help you do that.) Here is an example of what it looks like (notice 3 places where the username is outdated):

??--?-- Database: `user2_wrdp9`?--?CREATE DATABASE `user2_wrdp9` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;?USE `user2_wrdp9`;??--

#1044 - Access denied for user 'username1'@'localhost' to database 'wrdp9'
Same as the previous issue; the correct username is missing. On a shared sever, your database names must always look like something_something.

#1049 - Unknown database 'username1_wrdp9'
The problem is your import file does not have a query to create the database before importing the data. Simply go to cPanel > MySQL Databases and create a database with that name (in my example, "wrdp9"). Then re-attempt your import.

#1007 - Can't create database 'username1_wrdp9'; database exists
The problem here is your import file contains an SQL query that attempts to create a database that already exists. If the database is empty, simply go to cPanel > MySQL Databases and remove that empty database; then re-attempt your import. If the database is not empty, someone must edit the import file and remove the CREATE DATABASE query. (If you do not feel comfortable editing your import file, we will be glad to help you do that.) Here is an example of what it looks like:

?CREATE DATABASE `username1_wrdp9` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Less Common Issues

ERROR 1044 (42000): Access denied for user 'username1'@'localhost' to database 'username1_wrdp9'
If you get this error, you do not have privileges on user_* to use Create. HostGator needs to correct this issue for you.

However, if you need to import now, and can't wait, here is a work-around.

The problem here is your import file contains at least one SQL query that attempts to create a database, and you do not have the privilege to do so. Someone must edit the import file and remove the CREATE DATABASE query. (If you do not feel comfortable editing your import file, we will be glad to help you do that.) Here is an example of what it looks like:

?CREATE DATABASE `username1_wrdp9` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

After you remove this code, you must go to cPanel and click the MySQL Databases icon. Here you must create your database with the name which was removed from the import file (in my example, "wrdp9"). Then you can Import the modified import file and it will work.




Terms and conditions  | About us | Domain Names | Links | FAQ | Support
Copyright 2005-2012 LogoWebHost.com. All rights reserved.