Support Centre - MySQL

Dot Excel

Create Databases

Please click here for video tutorial or read the below:

Databases are not automatically created for your site; you need to create them. The number of databases you can create depends on your hosting plan.

Note: Disk space resource for a database is limited to the disk quota available for the site. If the database exceeds the available disk resources for the site, an error stating that the disk is full will be evidenced.

To create a database:

  1. In the shortcuts area of the Control Panel Home page, click MySQL Admin Tool (MySQL section).
  2. In the MySQL submenu, click Create Database. The Create Database form opens.
  3. Enter a name for the database in the Database Name field. For uniqueness, the name of the database is prefixed with the corresponding Site ID, in the Database Name field.
  4. Important: Database names should not exceed the maximum limit of 64 characters, inclusive of the prefix. For example, if your database prefix is 30 characters long, you must restrict the name of your database to a maximum of 30 characters, to conform to the limit (64). Four characters are reserved for internal use.
  5. Note: The Database Administrator is assigned by Dot Excel at the time of creating the site. This information is plugged into the Database Admin field and cannot be changed, except by Dot Excel.
  6. Click Save.

If the database has been successfully created, it will be added to the list of current databases for the site. An appropriate message is displayed above the list of databases.

If the process fails, or succeeds with attendant warnings, click the Details link to view related information.

Manage Databases

Please click here for video tutorial or read the below:

If MySQL is available to you, you can connect to the PhpMyAdmin MySQL interface to work with your SQL databases.

Note: You must connect to the PhpMyAdmin interface as a Database Administrator to access your MySQL databases. Your database administrator user name is assigned to you by Dot Excel while creating the site. To find out your database administrator user name, in the shortcuts section of the Control Panel Home page , click Site Information (Tools section). In the Configuration page, scroll down to the MySQL section to find the required information.

To connect to the PhpMyAdmin MySQL interface (if enabled for your site):

  1. In the shortcuts area of the Control Panel Home page, click MySQL Admin Tool (MySQL section). The Configuration window opens and displays information about, and links to the PhpMyAdmin MySQL Administration Tool.

  2. Click MySQL Administration Tool.

A new window opens, and you are prompted for your MySQL user name and password.

Connecting to MySQL database via PHP

1. Opening a connection to MySQL

Opening a connection to MySQL database from PHP is easy. Just use the mysql_connect() function like this:

<?php
$dbhost = 'localhost';
$dbuser = 'username';
$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                     
 ('Error connecting to mysql');


$dbname = 'dotexcel_com_au_ecommerce';
mysql_select_db($dbname);
?>

$dbhost is the name of MySQL server. When your webserver is on the same machine with the MySQL server you can use localhost or 127.0.0.1 as the value of $dbhost. The $dbuser and $dbpass are valid MySQL user name and password.

Don't forget to select a database using mysql_select_db() after connecting to mysql. If no database selected your query to select or update a table will not work.

2. Closing the Connection

The connection opened in a script will be closed as soon as the execution of the script ends. But it's better if you close it explicitly by calling mysql_close() function.

<?php

//close db connection
mysql_close($conn);
?>

Your PHP script that uses mysql would look something like this :

<?php
$dbhost = 'localhost';
$dbuser = 'username';
$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                     
 ('Error connecting to mysql');


$dbname = 'dotexcel_com_au_ecommerce';
mysql_select_db($dbname);

//Other database scripts ...

mysql_close($conn);
?>

 
Technology Used