Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    2

    Default mysql connection problems

    #!/usr/bin/perl
    #
    #
    use lib "/home/otterlak/public_html/cgi-bin/olscmod";

    use olsc;
    use DBI;
    use DBD::mysql;

    my $platform = "mysql";
    my $database = "";
    my $host = "otterlakesc.org";
    my $port = "3306";
    my $user = "";
    my $pw = "";

    #DATA SOURCE NAME
    my $dsn = "dbi:mysql:$database:$host:$port";

    print "content-type:text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>Hello World</title>\n";
    print "</head>\n";
    print "<body>\n";
    print "<b>Hello World!</b><br>\n";

    my $dbh = DBI->connect($dsn, $user, $pw) or print "Unable to connect: $DBI::errstr\n";

    # the line above produces the following error message
    # Unable to connect: Access denied for user blah blah blah
    # I am positve that my user name, password, and database name are correct!

    print "</body>\n";
    print "</html>\n";

    Any ideas?

  2. #2
    Join Date
    Mar 2011
    Posts
    2

    Default

    Finally got it .... the host was supposed to be localhost not otterlakesc.org.

  3. #3
    Join Date
    Mar 2011
    Location
    United Kingdom
    Posts
    4

    Default

    host should be localhost.
    fill in the database from your databaseName.

Similar Threads

  1. Help with remote connection to MySQL
    By gcaa in forum Hosting Related Questions
    Replies: 7
    Last Post: 01-13-2010, 10:42 AM
  2. Website connection Problems
    By davy in forum Hosting Related Questions
    Replies: 1
    Last Post: 02-04-2008, 07:52 AM
  3. php mysql connection from different sites(hosts)
    By amitbravo in forum Hosting Related Questions
    Replies: 1
    Last Post: 04-13-2007, 06:17 AM
  4. MySQL connection information
    By wikiot in forum Other Software and Applications
    Replies: 12
    Last Post: 07-02-2006, 01:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •