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.

Unable to connect mysql

Discussion in 'Database Discussions' started by mapiscor, Mar 11, 2008.

  1. mapiscor

    mapiscor Registered

    Joined:
    Mar 11, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi!
    Am pretty new to this and very naive about websites. Am using cpanel 11 provided by the host...I easily installed joomla 1.0.15 using fantastico and works perfect. since there's no option to install joomla 1.5 via fantistico, I manually removed 1.0.15 from public root as well as mysql database, then i created a new database name and user and upload 1.5 in public root, when i open my site it takes me to installation check but after entering all details such as host details, user name, password and database name. It shows error ..":confused:unable to connect to mysql..the number was returned by the host" am totally lost and confused. I've tried for about 2 days but cant get to work...got no choice but install back 1.0.15.

    I desperately need help here as the template I wanna use supports only joomla 1.5.

    Thanks in advance.:
     
  2. cPanelJesse

    cPanelJesse Technical Analyst Manager
    Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    51
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Houston
    cPanel Access Level:
    Root Administrator
    What hostname are you using when you try to install Joomla? Make sure to use localhost if the database is on the same server.

    Also remember that the names/logins of a database are user_dbname or user_username
     
  3. dare2audition

    dare2audition Registered

    Joined:
    Feb 18, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Having exactly the same problem, as I am on a dedicated server, when I login from my main site to the development it tells me I am logged in as root so I then log out and log back in, but when I tried to install joomla with the desktop installation, it cannot connect to mysql server and I am using database name eg develda_joomla1 and joomla1 is the database name, and also when I have to use username is that root or is that the user username and pword.
    Hope this hasnt confused things as I am confused.

    Also I have updated the cpanel to the new x3 but now all the database tables run in together in the cpanel, when I check them in the WHM they are in a nice neat row but in the cpanel both my development and live site have all the tables run across the page into each other.

    Help
     
  4. gtgeorge

    gtgeorge Well-Known Member

    Joined:
    Feb 28, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    If you created the DB for the user develda you will use the same prefix for the username as for the db. You will also need to create that username and password and then assign them to the DB develda_Joomla1 before you can access.
     
  5. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    This is a problem with the MySQL version that cPanel is using. MySQL 5.0.45 has a bug which won't allow Joomla 1.5 to install.

    Look here: http://help.joomla.org/content/view/1938/310/

    So, either cPanel needs to upgrade to 5.0.8 or downgrade to 5.0.2
     
  6. poolking

    poolking Registered

    Joined:
    Sep 21, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    I see nothing on that page that says there's a problem with mysql or I need my glasses changing?
     
  7. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    /me offers to clean poolking's glasses :)

    Scroll down...

     
  8. poolking

    poolking Registered

    Joined:
    Sep 21, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    Read again that says PHP you said MYSQL ;)
     
  9. fahed

    fahed Member

    Joined:
    Jun 13, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    check the database user privilege. check whether you can access the database from shell.
    ----
    mysql -u username -p
    ----
     
  10. fishfreek

    fishfreek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    238
    Likes Received:
    0
    Trophy Points:
    16
    One of my clients is seeing a simular issue. This is our problem.

    1) Created an addon domain (account has this ability)
    2) used Fantastico to install Wordpress
    3) After fantastico install completes sucessfully it produces an error when visiting the site. "Error establishing a database connection". Since fantastico setup the DB and the DB User and the password I can only assume they are right.

    But I have also gone and removed the user DB user account and created it again with a shorter password and then edited the wordpress conf file to reflect this change. Still no access.

    As suggested above I can connect to mysql from the command line with the username and password. I can even do a DB dump from the command line of the specific mysql database.
     
  11. Daniel W

    Daniel W Member

    Joined:
    May 19, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Houston, TX
    fix privileges

    You want to try running the following script to correct any privileges problems:

    /usr/bin/mysql_fix_privilege_tables
     
  12. codegirl42

    codegirl42 Well-Known Member

    Joined:
    Mar 9, 2006
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6


    any advice on how to execute this script?
     
  13. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    SSH into the server as the root user, then type the command exactly as listed above and press enter/return. Make sure you're doing this as root.


    Most of the time the error in this thread is due to bad access credentials. It's likely that the user trying to access MySQL is not granted privileges to access the specific database you are trying to connect to.

    Usually the following commands will fix this when logged into SSH as the cPanel user:

    Code:
    #mysql -u cpuser -p
    #GRANT ALL on databasename.* TO 'user'@'hostname' IDENTIFIED BY 'password';
    
    You need to replace the following variables:

    cpuser - your cPanel username
    databasename - name of the Joomla database
    user - username to access the Joomla database (in Joomla configuration file)
    hostname - typically 'localhost' unless MySQL is running on a remote server, if it is, the hostname of that remote server
    password - password for user
     
Loading...

Share This Page