Database Problems

Discussion in 'Linux VPS/Dedicated - General' started by Texpat, Jan 14, 2013.

  1. Texpat

    Texpat New Member

    Hello all,

    I have several websites of my own on a VPS, Some of those websites have database functions. Right now I have 2 databases. One has 1 table only; another has several tables.

    At my old host, they used HSphere and their databases were on a dedicated IP.

    So we used a :

    <?php require_once 'inc/dbconfig.php'; ?>

    The dbconfig looked like::

    <?php
    // Global Database Configuration
    // subject
    $dbms = 'mysql';
    $dbhost = 'IP addres';
    $dbport = '';
    $dbname = '';
    $dbuser = '';
    $dbpass = 'password';
    ?>

    I haven't been able to get that to work on my VPS. I'm not sure I actually understand the syntax requirement.

    Lets say my account is 'account'
    IP address is 'ip address'
    dbport = ?
    db name is .. account_databasename .. correct?
    dbuser is 'account'' .. yes/no?

    Then I saw something about 'priviledges' which makes me go cross-eyed.

    Also, I set up at least one database using the account level phpMyAdmin, not sure about the other. Should I delete that database and set it up with phpMyAdmin under 'root' ?

    Thanks,
     
  2. Dan

    Dan Moderator

    Hi Texpat,

    Sorry about the delay in answering this, it slipped by without my seeing it!

    If the databases are for accounts on your VPS then you should use phpMyAdmin in the cPanel for those accounts to create the DB and also the DB user. For permissions for that user you typically want to give it all privileges although sometimes different software will not require all privileges.

    If you have to use an IP address then you should use your main IP you've set up for your VPS. Typically in my installs I just use localhost.
    You should not even need a port number because you aren't making a connection to a different server, the database is local.
    You have the dbname correct.
    dbuser follows the same format as the dbname: account_dbuser

    Hope that helps
     

Share This Page