SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jan 2004
    Location
    Nashville
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Import a .sql file

    I am trying to import a .sql file.

    I created the database, then tried to import the file.

    phpmyadmin indicated that 634 queries were executed however when looking at the database there were no tables, therefor nothing to browse.

    I have never done this before, what did I do wrong?

  2. #2
    SitePoint Member RegistryExpert's Avatar
    Join Date
    Oct 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    To restore a .sql file, copy the file to bin folder of mysql installation and give the following command on command prompt while being in bin folder of mysql installation:

    mysql --add-drop-tables -u [rootuser] -p [databasename] < [filename.sql]

    replace [rootuser] with your username of root user.
    replace [databasename] with the name of database in which you want to import.
    replace [filename.sql] with the name of .sql file.

    If need further help, let me 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
  •