The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to set up a sql database

Discussion in 'Database Discussions' started by homaquebec, Jun 28, 2009.

  1. homaquebec

    homaquebec Registered

    Joined:
    Jun 28, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I created a sql database. I have the name that I gave + the username that I use to log to the FTP server, sot the dantabase name is database-name_usernagme. I have a username for this database (the name that I have to use when I log to the FTP server + _username. I also have a password for this user of the database.

    In an other part, I have the server name, the username that I use to connect to the FTP server and the passord.

    Now, to set up the database for a guesbook, I have the fields of those two sections to fill:

    Database ID
    Server (usually : localhost):
    User:
    Password:
    Database name:

    and

    Your ID to access the administration panel
    login:
    Password:
    Type your password again:
    Your Email :

    I tried different ways to give the informaton. It never worked. Could somebody tell me what I have to write at the seven questions (I know for the Email).

    Thanks in advance.
     
    #1 homaquebec, Jun 28, 2009
    Last edited: Jun 28, 2009
  2. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    If you created the database within cPanel/WHM, then the system automatically adds the account name as a prefix to both the mysql username and database...

    So, if you've named the dbase 'database-name_username' and your cpanel account name is 'cpanel', it's actually called ' cpanel_database-name_username'

    Same thing on user: 'ftpname_username' becomes 'cpanel_ftpname_username'

    Hope that makes sense...
     
  3. homaquebec

    homaquebec Registered

    Joined:
    Jun 28, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    How to set up a connection to a sql database?

    Thanks for answering.

    In fact, my question should have been : How to set up a connection to a sql database? This connection is necessary to establish a link between the database an a guestbook.

    So, please, tell me what to write in each field.:eek:

    Thanks.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:

    Your host can provide you the help you seek with this, that's what you pay them for. ;)

    To install a guestbook (a very bad idea these days as it's sure to be spammed so bad you'll get sick of it quickly, IMO) you go to your cPanel, click MySQL Databases icon, at top of page where it says New Database, type in a name for it, lets use guestbook for the name, click create.

    Down near bottom of page, find the section for Add New User, type in a username for it, this really would be better to use something else than your account username, lets use mrsmith for the name, type in a password or generate one from the tool here, then click Create user.

    Down below that where you see the Add User to Database, select the user you created that's listed here, and below that select the Database you created. Click Add, and you're done.

    Now, you have a database, and a user associated with it, you're ready for the guestbook.

    Upload your guestbook files to the location you want it to be in, let's say you want it at yourdomain.com/guestbook.

    Now you need to edit the guestbook config to work with the database.


    Server: localhost
    User: cpanelaccountname_mrsmith
    Password: yourpassword (user mrsmith's password, NOT, your cpaneluserpassword)
    Database name: cpanelaccountname_guestbook

    This last part:

    Your ID to access the administration panel
    login:
    Password:
    Type your password again:
    Your Email :

    I believe is for the administrator of the guestbook. This data is different than everything else. The login is the username you want on the site, could be webmaster for example. Give webmaster a password. And type in an email address where webmaster can receive the emails about all the spam you'll be getting on the guestbook.


    Again, your host is best suited to assist you with this sort of thing. Good luck.
     
    #4 Infopro, Jun 28, 2009
    Last edited: Jun 28, 2009
  5. homaquebec

    homaquebec Registered

    Joined:
    Jun 28, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Very clear explanations

    Thanks for your explanations. I succeeded to install the guestbook.

    Two things had to be changed.

    You wrote:
    cpanel must not be written in front of the accountname; the same thing for the database name. Maybe it is different with an other server or an other guestbook.

    Thanks and have a good week!
     
    #5 homaquebec, Jun 28, 2009
    Last edited: Jun 29, 2009
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Well, that was the example to show where the cpanelusername was to be placed. Good to hear you got it sorted all the same. ;)
     
Loading...

Share This Page