Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Default Imported datatabase via phpMyAdmin shows 0 size in cPanel

    Hi,

    Here are the steps I have done to add some databases from the another server:

    Step 1. Imported the databases via SQL using phpMyAdmin

    Step 2. Created a database user from cPanel

    Step 3. Run the following command from SSH

    /usr/local/cpanel/bin/dbmaptool ACCOUNT_USER --type mysql --dbs MY_DATABASE --dbusers DB_USER



    But I there are two problems with this approach:

    1. After running dbmaptool from "step 3." above, was able to let cPanel display the databases. But it did not assign the DB_USER to the database. Database connection will only work if I run the GRANT ALL PRIVILEGES command from MySQL client to this user, but still does not display the user assigned to the database in cPanel.

    Is something missing here?


    2. All imported databases are displaying database size as 0, although there are tables and data in it. This doesn't happen when a database is created from cPanel itself.

    I have already tried running

    /scripts/update_db_cache

    but without luck.




    Although there aren't any problems if everything was done within cPanel, I would like to run the commands from SSH, so it can be automated without needing any manual intervention.

    Thank you.

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,893
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Imported datatabase via phpMyAdmin shows 0 size in cPanel

    Steps 1 & 2 are backward, IMO. You should have the DB and user for it created before you import data into it.
    Fav cPlinks this week: Blog - cPanel & WHM 11.32 we love it! | cPanel University study for it! | Attracta is coming! we want this!

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Default Re: Imported datatabase via phpMyAdmin shows 0 size in cPanel

    Quote Originally Posted by Infopro View Post
    Steps 1 & 2 are backward, IMO. You should have the DB and user for it created before you import data into it.
    No, it's not backward, it's the exact step I need to process to achieve my goal. Let's say I have around 100 databases to important, then I need to create the database and user manually from cPanel which will probably take awful lot of time, instead I need the automated solution to be run from linux command line, accessing the cPanel API. Because I can create the commands within an text editor, just replace the database names for the command which will only take like 5 minutes, instead of hours.

    Hope that make sense. I need to do this frequently to move databases from one place to another for my customers, thank you.

  4. #4
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Default Re: Imported datatabase via phpMyAdmin shows 0 size in cPanel

    Okay, the 0 size problem seems to be solved, it took some time to get reflected in cPanel.

    Thanks.

  5. #5
    Member
    Join Date
    Jan 2007
    Posts
    65

    Default Re: Imported datatabase via phpMyAdmin shows 0 size in cPanel

    Quote Originally Posted by santocki View Post
    1. After running dbmaptool from "step 3." above, was able to let cPanel display the databases. But it did not assign the DB_USER to the database. Database connection will only work if I run the GRANT ALL PRIVILEGES command from MySQL client to this user, but still does not display the user assigned to the database in cPanel.

    Is something missing here?
    I've had this same issue. i have a script i'm using and i create the database/user and am able to map it with the cpanel dbmap tool command and the db and user shows up in cpanel mysql area. But then I run the ssh for granting all privileged and they don't show up in cpanel mysql area as granted (side by side) I still have to manually grant all privileged. Anyway, let me know if you figured this out or not.
    Thanks,

    Ben

Similar Threads & Tags
Similar threads

  1. Increasing max upload file size in cPanel phpMyAdmin
    By mealto in forum Database Discussions
    Replies: 17
    Last Post: 01-17-2012, 09:11 AM
  2. MySQL DB size shows 0 Mb in cPanel
    By sinys_85 in forum Database Discussions
    Replies: 7
    Last Post: 02-10-2011, 04:22 PM
  3. Increasing max upload file size in cPanel phpMyAdmin
    By mealto in forum cPanel and WHM Discussions
    Replies: 15
    Last Post: 09-03-2010, 12:54 AM
  4. cpanel shows sql database size 0
    By LAZer in forum New User Questions
    Replies: 4
    Last Post: 04-04-2010, 03:54 AM
  5. why cpanel shows more space for mysql db than phpmyadmin?!
    By -=JaNeK=- in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-16-2004, 01:29 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube