SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict drbones's Avatar
    Join Date
    Nov 2001
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    transfering a mysql db from a windows box to a linux box

    Hey guys,
    I just got a server at rackshack and have been learning php and converting my db to mysql.
    Anyways, I've converted my db's to mysql on my computer... but I can't figure out a way/place to use them on the server. I've created a DB in MyPHPadmin
    and retrieved data from it thre.. but it isn't letting me import a deliminated text file(which I really need to do since my DB's are HUGE... is there anyway to create a db on my machine(mysqL) which i have already done and upload it to the server so it will work?
    By the way, I'm running a plesk control panel.
    Thanks
    Ryan
    *WRITERS* Create How To Guides and articles and get
    75% of the MONEY it makes via Adsense forever!

    Sign up Now! <- $100 Top Poster Contest

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'd use mysqldump to dump it:

    Code:
    mysqldump --opt database > /path/to/dump/file.sql
    create the database on your host and add a user to it. upload the dumpfile, login via telnet/SSH, and import with mysql:

    Code:
    mysql database < /path/to/dump/file.sql
    insert the -uusername -ppassword options if necessary in both commands.

    if you don't have telnet/SSH access, you can run the second command from a PHP script:

    PHP Code:
    `mysql database < /path/to/dump/file.sql`; 
    Last edited by DR_LaRRY_PEpPeR; Apr 3, 2002 at 22:58.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  3. #3
    SitePoint Addict drbones's Avatar
    Join Date
    Nov 2001
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for info matt,
    Like i said earlier I just got a rack, and don't have that much linux/unix experience.
    ANyways.. I have no idea where the mysql databases are stored, any ideas where to look? I really need to get these records into the db soon...
    Thanks
    Ryan
    *WRITERS* Create How To Guides and articles and get
    75% of the MONEY it makes via Adsense forever!

    Sign up Now! <- $100 Top Poster Contest

  4. #4
    SitePoint Zealot zook's Avatar
    Join Date
    May 2001
    Location
    Houston, tx
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you said your running mysql on windows? in that case, i would assume that your databases are stored somwhere along the lines of:

    c:\mysql\data\database_name_here OR
    c:\program files\mysql\data\database_name_here

    ...depending on how you installed mysql.

  5. #5
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by drbones
    Thanks for info matt,
    Like i said earlier I just got a rack, and don't have that much linux/unix experience.
    ANyways.. I have no idea where the mysql databases are stored, any ideas where to look? I really need to get these records into the db soon...
    you don't need to know where the actual database files are to use mysqldump and/or import with mysql. /path/to/dump/file.sql is just where the dumpfile is stored. that can be anywhere. so if you FTP'd your dumpfile to the server, that directory may be /home/username/. so /path/to/dump/file.sql would be /home/username/dump.sql.

    BTW, the actual datafiles are probably in /var/lib/mysql/, if you wanted to know.


Bookmarks

Posting Permissions

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