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 import SQL dump for user?

Discussion in 'Database Discussions' started by vivithemage, Sep 12, 2013.

  1. vivithemage

    vivithemage Member

    Joined:
    Jul 2, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I have been trying to import an SQL dump, but am having no luck!

    I have been trying to use this, but no luck:

    Import MySQL Dumpfile, SQL Datafile Into My Database

    I have tried via phpmyadmin, but it just hangs there on a white page after a few seconds. The .zip dump was only about 26mb.
     
    #1 vivithemage, Sep 12, 2013
    Last edited: Sep 12, 2013
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can access your server via SSH as root and run the following command:

    Code:
    mysql database_name < /path/to/database.sql
    Or, if you need to complete the task as the username, you can run:

    Code:
    mysql -u username -p database_name < /path/to/database.sql
    Thank you.
     
  3. vivithemage

    vivithemage Member

    Joined:
    Jul 2, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I do that, but nothing happens after I enter the PW really.

    root@xx[/home/seacoast/www/SQL_Dumps]# mysql -u seacoast_bigdump -p seacoast_typ32 < seacoast_typ32.sql
    Enter password:
    root@xx[/home/seacoast/www/SQL_Dumps]#
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. vivithemage

    vivithemage Member

    Joined:
    Jul 2, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Nothing shows up, I wonder if the dmp is empty....
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's possible. You may want to review the dump file to see what it's contents are.

    Thank you.
     
  7. vivithemage

    vivithemage Member

    Joined:
    Jul 2, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    editing it in vi, all I see is:

    -- MySQL dump 10.11
    --
    -- Host: localhost Database: bigdump
    -- ------------------------------------------------------
    -- Server version 5.0.96-community

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  9. vivithemage

    vivithemage Member

    Joined:
    Jul 2, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, that's probably the issue.
     
Loading...

Share This Page