Web Analytics Made Easy -
StatCounter how to connect databse while uploading website - CodingForum

Announcement

Collapse
No announcement yet.

how to connect databse while uploading website

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to connect databse while uploading website

    I am trying to connect database while uploading my website. It is not connecting. Can anyone please tell me the procedure how to connect database online?
    Backend is Mysql

  • #2
    How are you trying to connect? - phpmyadmin, or the remote mysql tool?

    Some hosts disable remote connections.
    "Tango says double quotes with a single ( ' ) quote in the middle"
    '$Name says single quotes with a double ( " ) quote in the middle'
    "Tango says double quotes ( \" ) must escape a double quote"
    '$Name single quotes ( \' ) must escape a single quote'

    Comment


    • #3
      PHP Code:
      <?php
      define
      ('DB_HOST''localhost');
      define('DB_USER''root');
      define('DB_PASSWORD''');
      define('DB_DATABASE''altondb');
          
      mysql_connect("localhost""root""") or die("Could not connect to MySql" mysql_error());
      mysql_select_db("altondb") or die("could not select database" mysql_error());
      ?>
      using phpmyadmin we are trying to connect.

      Comment


      • #4
        can anybody send me any video links regarding database connectivity through phpmyadmin?

        Comment


        • #5
          PHP Code:
          <?php
          define
          ('DB_HOST''www.triviasoftwares.com');
          define('DB_USER''triviaso_allark');
          define('DB_PASSWORD''');
          define('DB_DATABASE''triviaso_altondb');
              
          $dbc mysql_connect('www.triviasoftwares.com''triviaso_allark''') or die("Could not connect to MySql" mysql_error());
          mysql_select_db('triviaso_altondb' $dbc) or die("could not select database" mysql_error());
          ?>
          this is code
          and the following error occurs

          Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'triviaso_alton'@'localhost' (using password: YES) in /home/triviaso/public_html/allark/config.php on line 8
          Could not connect to MySqlAccess denied for user 'triviaso_alton'@'localhost' (using password: YES)
          Last edited by Fou-Lu; Aug 30, 2011, 10:38 AM.

          Comment


          • #6
            You're user is not authenticated to that database server. Check with your host if that's supposed to be a remote mysql connection or if its still holds on localhost.
            In either case, you now have to change your password since you have posted in on a public forum.
            PHP Code:
            header('HTTP/1.1 420 Enhance Your Calm'); 
            Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

            Comment


            • #7
              sorry but
              Still getting this error...
              Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES) in /home/triviaso/public_html/allark/config.php on line 6
              Could not connect to MySqlAccess denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES)

              Comment


              • #8
                Originally posted by prachippp View Post
                sorry but
                Still getting this error...
                Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES) in /home/triviaso/public_html/allark/config.php on line 6
                Could not connect to MySqlAccess denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES)
                Of course you do.
                I specifically said that your user is not authenticated to that server. You will have to contact your host. Either the username and password combination you have provided is invalid or the user is not privileged on that mysql server. This is not a PHP issue, its a server configuration issue.
                PHP Code:
                header('HTTP/1.1 420 Enhance Your Calm'); 
                Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

                Comment

                Working...
                X