not able to import database

Discussion in 'Server Operation' started by armaclaren, Aug 21, 2018.

  1. armaclaren

    armaclaren New Member

    hey guys,
    I'm new to ISPconfig and ubuntu linux but I have been really enjoying ISPconfig so far!

    Where I'm stuck and could really use your help is; I've create an account on my ISPconfig server, for a website I have built on a hosted solution. The website transfers over to my ISPconfig server like a charm BUT, when I try to import the database. I receive the following error messages:

    Error 1:
    "DROP DATABASE" statements are disabled.

    Error 2:

    Error 3:
    SQL query:

    MySQL said:
    #1044 - Access denied for user 'c1dbadmin'@'localhost' to database 'remhe0_ak'

    I tried logging in to phpmyadmin as root and received an access denied error. I know the root password, It just wouldnt let me login, which I thought was weird.

    The user I created 'c1dbadmin' doesnt appear to have enough access to import the database ...I logged into my Ubuntu server and ran the following lines:

    mysql -u root -p
    GRANT ALL PRIVILEGES ON *.* TO 'c1dbadmin'@'localhost';

    This allowed me to import the database without an issue however, logged in as c1dbadmin. I'm not able to create another user that has access to that database and then limit the permissions of what that user can do.

    I guess what I'm asking is: how can I adjust the c1dbadmin account so that it could import the database without any command line... and also create a simple user that my website can use to access the database? ...just because now that c1dbadmin has "god mode", I'd rather create a restricted user with phpadmin that only has the basics of what my web application needs
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You made a mistake while exporting the database which is causing the import issues. You did not just export the database, you also exported a MySQL user and some statements to drop a database and to create the new database and that makes the import fail now as the user and database are already there and the user of that database shall not have grant permissions or permissions to drop and create databases. To fix that, export the database again and export just the database tables and the database content (or edit the exported sql file and remove the queries that try to create a new database and that try to add a new MySQL user).

    In regards to the mysql user you modified manually in your attempt to import the database, delete that one and the database and recreate the user and database in ispconfig. You opened a security hole in your setup by running this grant command and you should close it by removing the user and database and then recreating it.
  3. armaclaren

    armaclaren New Member

    Loading the tables worked like a charm!

    Thank you my friend. I think I was just looking way to closely at the problem. Thanks again!

Share This Page