Domain Search

Grab the best UK Prices

co.uk

From only £2.66

UK Hosting - Support

We are happy to help you - Ask Questions ?

General Database related questions

  • Q

    What is MySQL databases?

  • A

    MySQL databases allow you to store important information in a format that can easily be read by other programs and systems. You can use MySQL databases to store customer information or as the backend for a shopping cart system. You can read information on how to use MySQL at the MySQL website.

    From this area you can also manage your database by using phpMyAdmin, an easy to use web based interface for managing MySQL databases.

  • Q

    How do I create a MySQL database?

  • A

    If your account type permits MySQL, then log in to your UK Hosting Control Panel and select "Web Tools" and then "MySQL Databases".

  • Q

    How can I manage my MySQL database?

  • A

    Once you have created a database using your UK Hosting Control Panel you will be able to manage it using phpMyAdmin. Once the database is created you'll see a new option in the MySQL section of your UK Hosting Control Panel. You'll now be able to Edit/Manage/Delete your databases. To manage your database all you need to do is to click on the 'Now' link and phpMyAdmin will start.

  • Q

    How do I backup my MySQL database?

  • A

    Backing up your MySQL database can be done in several ways:

    1. Using the backup tool from the Web Tools section.
    2. Using phpMyAdmin web interface
    3. Using command line through shell access

    (1) Using our backup tool

    Log into your UK Hosting Control Panel and click on Web Tools. Click to configure MySQL Databases and click 'Now' under backup database. Save this file to your local machine.

    (2) Using phpMyAdmin

    Log into your UK Hosting Control Panel and click on Web Tools. Click to configure MySQL Databases and choose the database that you want to manage. This will start phpMyAdmin. PhpMyAdmin can export your entire database by selecting the "Export" page.

    1. Select all tables
    2. Select "Structure and data"
    3. Select "Add drop table"
    4. Select "Enclose table and field names with backquotes"
    5. Select "Save as file"
    6. Then click "Go" button

    You will be prompted to save the dump file on your computer.

    (3) Using MySQL command line tools

    To use MySQL command line tools, you will need SSH access to be enabled on your hosting account. You can perform backup using the following command:

    mysqldump -h servername -u username -p --add-drop-table --create-options --skip-add-tables --skip-add-locks -e --set-charset --disable-keys -Q databasename > databasedump.sql

    To backup and compress your dump file:

    mysqldump -h servername -u username -p --add-drop-table --create-options -e --set-charset --skip-add-locks --disable-keys -Q databasename | gzip > databasedump.sql.gz

    The commands above will create the dump file in your current directory. You can download this backup file using scp or ftp for your archival purposes. If you perform this command in the public_html directory (or if you move the file into the public_html directory), you will be able to download this file from the web.

  • Q

    How can I upload my MySQL database?

  • A

    There are numerous ways to upload a MySQL database, we would strongly recommend trying methods 2 and 3 Method 1 – phpMyAdmin

    You may use phpMyAdmin to load your database by using the Import link to upload a .sql file or by pasting the SQL script into a query window and executing it. For the latter method -
    1. Login to phpMyAdmin with a MySQL user that has been given DBA rights to the MySQL database you wish to load.
    2. Then click on the SQL tab.
    3. Paste the SQL script content into the text area, and click Go.
    If the SQL script contains a lot of data, you might still get away with this by pasting it bit by bit. If the data is simply too large, see the other sections.

    Method 2 - UK Hosting restore

    In the UK Hosting control panel go to the MySQL Databases page.
    On this page is the text "To restore a database which you've previously backed up, click here."
    If you follow the link, you can upload a larger SQL file than would be possible in phpMyAdmin.

    If the SQL file is very large, please consider one of the other methods below

    Method 3 - MySQL Administrator

    MySQL offer free software to manage, backup and restore MySQL databases.
    The software can restore very large files, and also comes packaged with MySQL Query Browser, which can be used a faster alternative to phpMyAdmin
    You can download the software at http://dev.mysql.com/downloads/gui-tools/5.0.html

    Method 4 - MySQL command line client

    This requires you to have SSH Access, which may or may not be available on your particular package.
    Due to the limitations imposed by PHP, phpMyAdmin is unable to load a large MySQL dump data.
    You can upload the MySQL dump file created by mysqldump --opt -Q dbname to your home directory, and then execute the MySQL client to load it.

    To load your sql dump using MySQL, you can use the following command:

    mysql -h mysqlhost -u mysqlusername -p databasename < dumpfile.sql

    or

    cat dumpfile | mysql -h mysqlhost -u mysqlusername -p databasename

    Where:

    mysqlhost - The name of the server where your MySQL database is located. You can find this out from the Control Panel in the MySQL Database area.
    mysqlusername - Your MySQL User name as created through the Control Panel.
    databasename - This is the name of your database
    dumpfile.sql - The file created by mysqldump

  • Q

    How do I connect to my MySQL database?

  • A

    Once you have created a database using your UK Hosting Control Panel you will be able to manage it using phpMyAdmin. Once the database is created you'll see a new option in the MySQL section of your UK Hosting Control Panel. You'll now be able to Edit/Manage/Delete your databases. To manage your database all you need to do is to click on the 'Now' link and phpMyAdmin will start.