Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    3

    Unanswered: .frm files or .sql files??

    Hi there

    I've been using mySQL just on my own computer hard drive while I've been learning and putting together a little app.

    Now I want to try and load my app onto some web space. I've put all the client side and server side code up there and all I've got to do now is get my database files up.

    The web host has phpmyadmin, so I thought I could use that, but I can't seem to work out how to do it. When I google a tutorial, the tutorial always ends up saying 'now upload the .SQL file'.

    What .SQL file?

    I'm looking in the mySQL folder in the Program Files on my c drive and I eventually come to a 'data' folder where there is a folder for each of the databases I have. In those folders, there aren't any .SQL files, but instead there is a .frm file for every table I've made plus one file called db.opt.

    I would be very grateful if someone could tell me what I have to do with these files in order to get them up and running on my godaddy webspace.

    Many thanks guys

    Joe

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    the .sql file is a text file which is produced when you dump a table

    the mysqldump command produces one

    you can also produce one using phpmyadmin in the Export tab -- there are options to dump the structure (CREATE TABLE statements), the data (INSERT statements) or both

    when you sign on to phpmyadmin on your server, simply open the .sql file in the SQL tab and run it
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Apr 2009
    Posts
    3
    Hi there

    Thank you very much for your reply.

    I've looked up the mysqldump command and tried to use in the mysql command prompt, but I keep on getting the 'error in sql syntax' error.

    I've tried 'mysqldump --help;', but I get the bad syntax error.

    I've tried loads of different variations and followe what it said in the mysql literature, but I can't seem to get anywhere. From what you said, making a .SQL file using mysqldump is exactly what I want to do.

    Any suggestions?

    Many thanks

    Joe

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by joelemmer
    Any suggestions?
    if you already have phpmyadmin installed on your local system, just use that -- use the Export tab

    if you haven't, download and install HeidiSQL (windows only) -- i find it to be far superior to phpmyadmin

    the .sql file produced by heidi is of course completely compatible with the phpmyadmin on your host's server, since it uses only CREATE TABLE and INSERT statements

    i've never actually used any command line commands -- too many bad flashbacks to the early days of DOS on 8086 machines

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Apr 2009
    Posts
    3
    Hi sorry to bother you again. I've downloaded HeidiSQL and it looks great. I've exported the database that I want to export and it has produced a .SQL file. Nice!

    The phpmyadmin is objecting to a line of code in the .SQL thus:

    'SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI';
    SET @OLD_FOREIGN_KEY_CHECKS=@@F' at line 2

    the corresponding couple of lines in the .SQL file read:

    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI';*/
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;*/

    I'm really not sure what it means by foreign key checks. On the import page of phpmyadmin (which I have to use to upload my DB to my webspace) it gives me options to select the format of the file, so I selected ANSI (I've also tried none) and character encodeing, which I've selected Latin1 which is said something about in the SQL code (I've also tried UTF-8).

    I can't see anything to do with foreign key checks. I could try deleting that line, but I don't know whether it's important or not.

    Sorry to hassle you again, buit any help would be much appreciated.

    Cheers

    Joe

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, you can just delete those lines (you'll notice they are comments, enclosed by /* and */ -- so i'm not sure why phpmyadmin is trying to execute them)

    i guess my comment about the sql produced being compatible was slightly off

    do your tables actually employ FKs?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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