Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2011
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 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
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,325
    Thanks
    60
    Thanked 525 Times in 512 Posts
    Blog Entries
    4
    How are you trying to connect? - phpmyadmin, or the remote mysql tool?

    Some hosts disable remote connections.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • Users who have thanked tangoforce for this post:

    prachippp (08-30-2011)

  • #3
    New Coder
    Join Date
    Jun 2011
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New Coder
    Join Date
    Jun 2011
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts
    can anybody send me any video links regarding database connectivity through phpmyadmin?

  • #5
    New Coder
    Join Date
    Jun 2011
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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; 08-30-2011 at 02:38 PM.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.

  • #7
    New Coder
    Join Date
    Jun 2011
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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)

  • #8
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote 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.


  •  

    Posting Permissions

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