SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the command you use to run a .mysql file in mysql using telnet?

    Am I making sense?

    ------------------
    KeithMcL - KMcLUK@aol.com
    http://www.webmasterswork.com - #1 source for web developer jobs online.
    http://www.webdesignreviews.com - Reviews by the experts.

  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should work:

    mysql -u USER -p DATABASE < file.mysql

    ------------------
    Karl Austin
    KDA Web Services
    "Everyone has a photographic memory. Some just don't have film."

  3. #3
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Karl, that doesn't seem to work. When I type it in (changing the neccessary parts of course) it just goes onto the next line with
    -> and that's all.

    Tried entering a ; on the next line but I get Error 1064: You have an error in your sql syntax near 'mysql -u USER -p DATABASE < file.mysql at line 1

    Any ideas?

    ------------------
    KeithMcL - KMcLUK@aol.com
    http://www.webmasterswork.com - #1 source for web developer jobs online.
    http://www.webdesignreviews.com - Reviews by the experts.

  4. #4
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Sorry I should have explained myself a bit better, you need to type that command at the command prompt:

    /path/to/mysql/mysql -u USER -p DATABASE < DATABASEFILE.mysql

    /path/to/mysql is the path to MySQL on your server, usually /usr/local/mysql/bin/

    Also if the .mysql file creates the database for you and not just the tables then you can get rid of DATABASE from the above code.

    Hope I have explained it better this time.

    ------------------
    Karl Austin
    KDA Web Services
    "Everyone has a photographic memory. Some just don't have film."

  5. #5
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help Karl,

    I decided to open the .mysql file in a text editor and manualy add each table and it's contents.

    Thanks again for your help

    ------------------
    KeithMcL - KMcLUK@aol.com
    http://www.webmasterswork.com - #1 source for web developer jobs online.
    http://www.webdesignreviews.com - Reviews by the experts.


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
  •