website design, maintenance, and hosting

mySQL


Please choose the following question.

If you can't find your question, please let us know and we'll answer it in e-mail and add it to the FAQ.

  1. What is the name of my mySQL database?
  2. How I can query my mySQL database directly for debugging purposes?
  3. Is there a perl API for mySQL?

What is the name of my mySQL database?

Your mySQL database name is the same as your account name.

How I can query my mySQL database directly for debugging purposes?

Telnet to the server and log in using your account name and password. It will be the password that was assigned to your account when the mySQL database was created. Then invoke the mySQL monitor with the following command:

/usr/local/bin/mysql --user=youracct -p youracct

Where youracct is your account name.

Is there a perl API for mySQL?

The mysql perl API which comes with mysql is installed.

For more information refer to the documentation at http://mysql.he.net

Here is a quick demonstration of a generic query:


	use Mysql;

        if ( ! ( $gDBH = Mysql->Connect("servername",
                "database","passwd","user") ) )
        {
                die "SQL Error: $Mysql::db_errstr";
        }

        my $sth = $gDBH->query( "select * from tablename" );

        if ( ! defined $sth )
        {
                die "SQL Error: $Mysql::db_errstr";
        }

        for (;;)
        {
                my %hash;
                last if ! ( %hash = $sth->FetchHash() );

                foreach $key ( sort keys %hash )
		{
                        printf( "%16s: %s\n", $key, $hash{$key} );
                }

                print "\n";
        }



Have You Seen Me?Call 1-800-THE-LOST if you've seen this child. Click on the image for case details. We support the work of the National Center for Missing and Exploited Children.
Click Here To Add A Missing Child Link To Your Pages!


Back to FAQ Index

 

e-mail

Send E-Mail to:
comments@dss-sites.com

http://www.dss-sites.com

Dealer Support Services
203 Pine Street
Fulton, NY 13069-2429
Phone: (315) 598-8082
Fax: (315) 422-3837