If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > .frm files or .sql files??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-09, 08:44
joelemmer joelemmer is offline
Registered User
 
Join Date: Apr 2009
Posts: 3
.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
Reply With Quote
  #2 (permalink)  
Old 04-07-09, 09:45
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 04-07-09, 11:34
joelemmer joelemmer is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 04-07-09, 11:43
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 04-07-09, 12:23
joelemmer joelemmer is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 04-07-09, 12:48
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On