Home > MySQL

MySQL

Connecting to MySQL using PHP.

PHP access to MySQL is available but access is restricted to the Pulsant web servers.

PHP provides specific support for MySQL:

$db = mysql_connect($servername, $username, $password);

You will need to set $servername, $username and $password to suit your database as detailed for MySQL

Both mysql_connect and mysql_pconnect should work, but pconnect will provide a persistent connection if required. For more details, have a look at: http://www.php.net/manual/en/ref.mysql.php

Connecting to MySQL using C#.

To open an ODBC connection from Windows 2003 to a MySQL database, use the following piece of C# code:-

string connString = “DRIVER={MySQL};SERVER=servername;DATABASE=dbname;UID=mysqlusername;PWD=mysqlpassword”;
System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection(connString);
conn.Open();

You will need to set servername, dbname, mysqlusername and mysqlpassword to suit your database as detailed for MySQL

Please remember to call conn.Close(); to close the connection afterwards

MySQL access via the command line interace.

Command line access to MySQL is available but access is restricted to the Pulsant shell server. Shell access is available on all Pulsant webspace accounts but is disabled by default, if you would like this enabled simply email [email protected] and we will do this for you.

  1. Connect to shell.lumison.net, using SSH, and log in using your webspace username and password (Note that if using windows web hosting you will have 2 passwords and you will need to use the one associated with your email).
  2. Type ‘mysql -h mysql.lumison.net -u <user name> -p <database name>’ and press enter.

This will ask for your database password and will then take you to the MySQL command interface.

Note that <server name>, <user name> and <database name> should be substituted by the details specific to your database, see the MySQL server details.

Importing a MySQL database from the command line.

Command line access to MySQL is available but access is restricted to the Pulsant shell server. Shell access is available on all Pulsant webspace accounts but is disabled by default, if you would like this enabled simply email [email protected] and we will do this for you.

To import a MySQL database you must first have a file containing the required SQL (import.sql in our example), upload this to your web space account and then use the following command to save this into the database.

  • Upload your SQL file to your Linux webspace.
  • Connect to shell.lumison.net, using SSH, and log in using your webspace username and password (Note that if using windows web hosting you will have 2 passwords and you will need to use the one associated with your email).
  • Change directory to the location of the uploaded SQL file.
  • Type ‘mysql -h mysql.lumison.net -u <user name> -p <database name> < import.sql’ and press enter.

This will ask for your database password, will import the SQL file and return you to a command prompt.

Note that <server name>, <user name> and <database name> should be substituted by the details specific to your database, see the MySQL server details.

Exporting a MySQL database from the command

Command line access to MySQL is available but access is restricted to the Pulsant shell server. Shell access is available on all Pulsant webspace accounts but is disabled by default, if you would like this enabled simply email [email protected] and we will do this for you.

  • Connect to shell.lumison.net, using SSH, and log in using your webspace username and password (Note that if using windows web hosting you will have 2 passwords and you will need to use the one associated with your email).
  • Change directory to the location you would like to save your SQL file.
  • Type ‘mysqldump -h mysql.lumison.net -u <user name> -p <database name> > export.sql’ and press enter.

This will ask for your database password, will export the SQL file and return you to a command prompt. You will then be able to download the file from your Linux web space if required.

Note that <server name>, <user name> and <database name> should be substituted by the details specific to your database, see the MySQL server details.

Is there a web interface (e.g. phpmyadmin) provided for MySQL.

phpMyAdmin is available at http://www.lumison.net/phpmyadmin/ or simply append the path to your domain name, e.g. http://www.example.com/phpmyadmin/

Pulsant do not provide support for the use of this application but supplier documentation is available at http://www.phpmyadmin.net/home_page/docs.php

Note

The server is configured using directory Aliases for /phpmyadmin, /phpMyAdmin and /mysqladmin to allow phpmyadmin to be displayed on all hosted domains. This means that you will not be able to use these directory names for other applications.

MySQL – server details.

Note that the database server can only be accessed from the Pulsant web and shell servers.

  • hostname: mysql.lumison.net
  • username: as supplied by Pulsant. (This will consist of the
    associated account username and may have a suffix).
  • password: as supplied by Pulsant and will match the username.

Connecting to MySQL using perl.

Perl access to MySQL is available but access is restricted to the Pulsant web servers.

We support the use of DBI, the standard method for Perl:

use DBI;
$dbh = DBI->connect(‘dbi:mysql;database=DATABASE; host=$servername’, $username, $password);

You will need to set $servername, $username and $password to suit your database as detailed for MySQL

MySQL – Service overview

MySQL
Verson: 5.0.77
Website: http://www.mysql.com

Features and limitations:-

  • Access provided via TCP/IP but permitted only from Pulsant web, mail and shell servers.
  • Command line ‘mysql’, Perl DBI, PHP and JDBC clients are supported.
  • One login will be created per database which must be named after, or prefixed with, a valid system account name.
  • Standard MySQL commands (for the specified version) are permitted.
  • Server-side file access (e.g. LOAD DATA INFILE) is disabled.
  • 50MB disk allocation plus normal Pulsant ‘Storage allocation’ rates.