Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2007
    Posts
    688

    restore db fails

    root@server [~]# mysql -u divingho_dhadmin -p divingho_divinghols < /home/divingho/mysql/divinghols.sql
    Enter password:
    ERROR 1044 (42000) at line 11: Access denied for user 'divingho_dhadmin'@'localhost' to database 'divinghols'




    The username is right, the password I use is correct. I even deleted, recreated the mysql database and username, still giving the same error. The path to sql file is right and only 68k in size.

    Using mysql 4.1

  2. #2
    Join Date
    Jun 2006
    Location
    Cluj Napoca
    Posts
    469
    have you entered the password correctly ? I am asking because at the first line, to enter a mysql password you will need to add "-pPassword" and not "-p Password".
    IntoDNS - Check your DNS health and configuration
    FLEIO - OpenStack billing and control panel for service providers

  3. #3
    Join Date
    Jan 2007
    Posts
    688
    Yes I did that, still giving off the same error

  4. #4
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,771
    Try this command.

    mysql -u divingho_dhadmin -D divingho_divinghols -pPASSWORD < /home/divingho/mysql/divinghols.sql
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  5. #5
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    The original command looks correct to me, -p alone will prompt for a password (as it did).

    Are you sure the database name is correct?
    Quote Originally Posted by Calibaba View Post
    root@server [~]# mysql -u divingho_dhadmin -p divingho_divinghols < /home/divingho/mysql/divinghols.sql
    Enter password:
    ERROR 1044 (42000) at line 11: Access denied for user 'divingho_dhadmin'@'localhost' to database 'divinghols'
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  6. #6
    Join Date
    Jan 2006
    Location
    Somewhere in USA
    Posts
    110
    Did you allocated the user to the database, if you have Cpanel you can do that from the Cpanel account ?
    https://www.vpnin.net - Reliable and secure vpn services

  7. #7
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Hang on, this is all wrong:
    ERROR 1044 (42000) at line 11
    What's at line 11 of your sql file? "CREATE DATABASE divinghols" perhaps? Your cpanel database user doesn't have create database privileges.

    Edit: Take out the create database statement and you should be set. The database name and password were correct or you wouldn't have got as far as line 11.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  8. #8
    Join Date
    Jan 2006
    Location
    Athens, Greece
    Posts
    1,481
    The error is clear, the user doesn't have privileges to the database

  9. #9
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,771
    Quote Originally Posted by Steve_Arm View Post
    The error is clear, the user doesn't have privileges to the database
    Well, foobic is correct here. The sql file has got another database name inside it. And the databases user used here don't have access to that database. The database user has got access to the database specified in the command line.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  10. #10
    Join Date
    May 2006
    Location
    India
    Posts
    661
    You can go a head and restore that MySQL in the superuser(as root) context, and then grant correct privileges for the user to access this DB
    SparkSupport.Com - The Premier Tech Company
    Cloud Solutions|Email Infra setup|VOIP|Video Streaming|Software Development
    Email: info@sparksupport.com Phone : 1- 408-600-1449 | Skype : shijils

  11. #11
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Well, he could do that but then he'd have a database (divinghols) that's completely out of cpanel's control because it doesn't follow the correct naming convention (divingho_divinghols).

    He's already created the new database in cpanel, he just needs to take out the lines "create database divinghols" and "use divinghols" from the sql file.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

Posting Permissions

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