TheMACisp
TheMACisp
LOGINWEBMAILSUPPORTSTUFFGOODIESQUICKTIMESERVICES
Back   mySQL Support

mySQL

mySQL is an open source database service that uses a superset of the popular and widely used Structured Query Language (SQL). There are various ways to use mySQL in conjunction with your TheMACisp hosting account. Presented here are some particulars for the interface with our supported software and languages.
MySQL Help

Using mySQL with Perl

You can access a mySQL database using the venerable Perl programming language. Although Perl itself has no commands for handling database querys, Perl has a wealth of libraries and modules available some of which do exactly that. TheMACisp supports the DBI Perl module which was created for accessing databases. To involk the DBI module put the following line into your Perl sourcecode:

use DBI;

The DBI documentation outlines the various methods you can use to read and write data to your database. This page only shows code segments particular to the use here at TheMACisp. For detailed instructions and examples refer to the Perl DBI documentation. (this one takes a while to load... please be patient)

To link to your database here at TheMACisp, use the following syntax in your "connect" statement.

my $dbh = DBI->connect("DBI:mysql:database={db_your database name}:mydb.sowhatsoftware.net", "{your username}", "{your password}");

Your mySQL database is named the same as your domain name with a "db_" prepended, the {your username} and {your password} notations are your username and password (no curly brackets).

NOTE: Domain names that contain a dash (-).
Domain names containing a dash have their dashes removed when referencing MySQL. A dash is a reserved character in MySQL and can not be used in database names. All periods (.) are changed to underlines. For example: if your domain name is my-website.com, your database name would be db_mywebsite_com.


Using mySQL with PHP

PHP has comprehensive mySQL commands built in to the language. TheMACisp supports PHP3 and PHP4 both of which support mySQL database access. For detailed instructions and examples refer to the PHP mySQL documentation.

To link to your database here at TheMACisp, use the following syntax in your "mysql_connect" and "mysql_select_db" statements:

<?php $id = mysql_connect('mydb.sowhatsoftware.net:3306', '{your username}', '{your password}'); mysql_select_db('{db_your database name}', $id);?>

Your mySQL database is named the same as your domain name with a "db_" prepended, the {your username} and {your password} notations are your username and password (no curly brackets).

NOTE: Domain names that contain a dash (-).
Domain names containing a dash have their dashes removed when referencing MySQL. A dash is a reserved character in MySQL and can not be used in database names. All periods (.) are changed to underlines. For example: if your domain name is my-website.com, your database name would be db_mywebsite_com.


Using mySQL with Adobe GoLive 6.0.1

GoLive provides for Dynamic Linking to mySQL databases via the Dynamic Site Wizard. Your site must be enabled for PHP Dynamics prior to declaring a dynamic data source, the Dynamic Site Wizard steps you though this process. It is recommended to design the site as pure HTML and then convert portions of the site to Dynamic after the design phase is complete. During this conversion, you are given the opportunity to declare your Dynamic Data Source(s). In real world application however, Dynamic Sources and PHP integration often happed during the development of the site and not as a single post process after the fact as is recommended.

Declaring a Dynamic Data Source can only be accomplished on a site that has already been initialized by the Dynamic Site Wizard. To add a Dynamic Data Source to your initialized site, use the following procedure.

NOTE: Domain names that contain a dash (-).
Domain names containing a dash have their dashes removed when referencing MySQL. A dash is a reserved character in MySQL and can not be used in database names. All periods (.) are changed to underlines. For example: if your domain name is my-website.com, your database name would be db_mywebsite_com.

With your initialized site file open, select Site-Settings... from the GoLive pull down menu.
The Settings window will appear. Choose New from the Data Source section.
The Add Data Source window will pop-up, Highlight the mySQL Database selection and click Add Data Source.
The mySQL Data Source window will pop-up. Enter the following information to establish a connection to your mySQL database here at TheMACisp:

Data Source Name: anything you want

Host: mydb.sowhatsoftware.net:3306

Database: {db_your database name}

User: {your username}

Password: {your password}

This is a good time to Test your datasource, providing you have already put some data and structure in your database. When all is good, click OK to save these settings.

Using mySQL with Macromedia Dreamweaver MX

Dreamweaver MX provides for Dynamic Linking to mySQL databases. Your site must be initialized with a test (or publishing) server first, refer to Dreamweaver Setup. To add a Dynamic Data Source to your initialized site, use the following procedure.

NOTE: Domain names that contain a dash (-).
Domain names containing a dash have their dashes removed when referencing MySQL. A dash is a reserved character in MySQL and can not be used in database names. All periods (.) are changed to underlines. For example: if your domain name is my-website.com, your database name would be db_mywebsite_com.

Select File - New from the Dreamweaver pull down menu to create a new document.

You can change an existing document to dynamic by going directly to the sidebar menu and following the prompts there.
In the New Document setup window select Dynamic Pages in the Category column and select PHP from the Dynamic Pages column. Click Create to create the dynamics enabled webpage.
Click the Databases tab from the sidebar menu and click the plus sign (+).
The mySQL Connections window will pop-up. Enter the following information to establish a connection to your mySQL database here at TheMACisp:

Connection Name: anything you want

mySQL Server: mydb.sowhatsoftware.net:3306

User Name: {your username}

Password: {your password}

Database: {db_your database name}

This is a good time to Test your datasource, providing you have already put some data and structure in your database. When all is good, click OK to save these settings.


56K Dialup | OSX Hosting | 56K Dialup + | Numbers | Status | Support | Login | Webmail | Streaming Dead
Streaming Phish | Hitchikers... | Time Warp | Contact | Logos | Agreements | Policies

© 2000-2009 So What Software, Inc. This site is served on OSX server and was created using Adobe® GoLive 6. Mac, Apple, iChat, WebObjects and Quicktime are registered trademarks of Apple Computer Inc. GoLive is a registered trademark of Adobe Systems Incorporated. Dreamweaver is a registered trademark of Macromedia, Inc. Internet Explorer, Outlook Express and Entourage are registered trademarks of Microsoft Corporation. Eudora is a registered trademark of QualComm Corporation. MySQL is a registered trademark of MySQL AB. Netscape is a registered trademark of Netscape Communications Corporation.