How do I split my database?

Discussion in 'MySQL' started by akasixcon, Apr 7, 2007.

  1. #1
    So i have made a backup datebase file of my forums. Its 3.8 mb big. I am using WAMP offline to try to use it but the maximum upload file size in the "import" under PHPMYADMIN is only 2mb.

    Either A) I need to know how to make it bigger than that or

    B) How do I split my database file easily? I've done it manually before but is there an automated way to do this without breaking the tables incorrectly?
     
    akasixcon, Apr 7, 2007 IP
  2. briansol

    briansol Well-Known Member

    Messages:
    221
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #2
    if its local, there's 0 need to even upload it... its already there.

    just go to the mysql command prompt and run the correct import query (google ssh mysql import)


    you might be able to change your php.ini max_upload_size paramater to allow phpmyadmin to upload larger files... not sure how this works on windows though.
     
    briansol, Apr 10, 2007 IP
  3. akasixcon

    akasixcon Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I need more info on this one...
     
    akasixcon, Apr 22, 2007 IP
  4. prophecy

    prophecy Guest

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Where is the backup? On a remote box? Can you ssh into the box?
     
    prophecy, Apr 22, 2007 IP
  5. akasixcon

    akasixcon Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The backup is on my PC. I have no idea waht SSH is , i'm using WAMP try the database file backup on my pc.
     
    akasixcon, Apr 22, 2007 IP
  6. prophecy

    prophecy Guest

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    So it's all local? And you have a .sql backup file from MySQL?

    If so, run from the command prompt: mysql DATABASE_NAME < backupfile.sql

    Or get the MySQL GUI tools from mysql.com and do restore the database using MySQL Administrator.
     
    prophecy, Apr 22, 2007 IP
  7. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #7
    I want to ask another related question. How can I copy the database content to another database ?
     
    energetic, Apr 22, 2007 IP
  8. prophecy

    prophecy Guest

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You'll want to do a backup then a restore like akasixcon has done. You can restore it to any database.

    I'd get the MySQL Administrator GUI to make it easy.
     
    prophecy, Apr 22, 2007 IP
  9. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #9
    prophecy, Thanks. I want to make all database the same with 50 users, how can I do it in linux command line mode ?
     
    energetic, Apr 22, 2007 IP
  10. prophecy

    prophecy Guest

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    backup:
    > mysqldump DB_NAME > DB_NAME.sql

    load:
    > mysql DB_NAME < DB_NAME.sql
     
    prophecy, Apr 22, 2007 IP
    energetic likes this.
  11. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #11
    hi, prophecy, I received error message as below:

    mysqldump: Got error: 1045: Access denied for user 'd001'@'localhost' (using pas sword: NO) when trying to connect
     
    energetic, Apr 22, 2007 IP
  12. prophecy

    prophecy Guest

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    mysqldump -u YOUR_MYSQL_USERNAME_THAT_HAS_ACCESS_TO_DB_NAME -pYOURPASSWORD DB_NAME > DB_NAME.sql
     
    prophecy, Apr 23, 2007 IP