need learn how to add database to my sites

Discussion in 'Databases' started by mrsclause, Sep 20, 2010.

  1. #1
    I have no idea how to do this anyone have some ideas or some sites i can go to to read how to do this
     
    mrsclause, Sep 20, 2010 IP
  2. gismo

    gismo Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Given you dont know how to do this i assume you are not self hosting, so you should first login into your hosting providers control panel usually cpanel, here you can use the add database wizzard or i recommend just add it manually (add msql database). Once you have created the database you then need to add a user to it give it full privelidgess unless you know exactly what privelidges you need. Then from cpanel you can phpmyadmin to login and manage the database.

    The last step is to connect the databse to the website but this will vary depending what website you have if you have a cms of some kind you will easily frind intructions out there or just tell us here.
     
    gismo, Sep 20, 2010 IP
  3. mrsclause

    mrsclause Peon

    Messages:
    146
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have my own server but the person I get my server from puts them on. it will be much eaiser if I could find out how to do it. I did just that and it did not work> I don't know what I did wrong.
     
    mrsclause, Sep 20, 2010 IP
  4. susan_ham

    susan_ham Peon

    Messages:
    352
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you use cpanel as your hosting's control panel, you can click icon MYSQL Database and add database in it. If you can't complete it by yourself or you have no authority to add database, you should contact your hosting provider and ask them for help.
     
    susan_ham, Sep 22, 2010 IP
  5. find

    find Banned

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    which database you want learn
     
    find, Sep 22, 2010 IP
  6. nzk0

    nzk0 Greenhorn

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    you'll also need to invoke your DB in whatever script your using with a snippet like this:

    <?php
    $dbhost = "localhost";
    $dbname = "database_name";
    $dbuser = "database_user";
    $dbpass = "database_password";

    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

    $db = mysql_select_db($dbname);
    ?>
     
    nzk0, Sep 22, 2010 IP
  7. nirajkum

    nirajkum Active Member

    Messages:
    815
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #7
    start learning mysql and create few simple tables then go from there by learning more about the php and mysql its easy
     
    nirajkum, Sep 24, 2010 IP
  8. johnclouseau

    johnclouseau Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    creating simple tables in SQL will make you perfect with DataBase and once done it becomes easy when you log in into Cpanel of your hosting.
     
    johnclouseau, Sep 24, 2010 IP