Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: MYD's & frm's ?

  1. #1
    Senior Member
    Join Date
    Nov 2003
    Posts
    248

    Default MYD's & frm's ?

    Hi I'm new to databases, I can get my program working locally on apache/mysql.
    But when I upload to the WH server into a subfolder I cant - I get cant connect to database.
    I've installed mysql. I've checked the codes I dont know if the "localhost" connection is the problem - I've checked the filename connection is right.

    Pls advise.

  2. #2
    Moderator wildjokerdesign's Avatar
    Join Date
    Jun 2003
    Location
    Kansas City Mo
    Posts
    5,720

    Default

    Was this request to do with the card script that you got going?

    I have phpMyAdmin installed on my sites that use mysql databases so I can check the existance of a database. I have run across a couple scripts that you have to create the database yourself since they do not do it and phpMyAdmin makes it really easy.
    Shawn
    Please remember your charity of choice: http://www.redcross.org

    Handy Links: wildjokerdesign.net | Plain Text Editors: EditPlus | Crimson

  3. #3
    Senior Member
    Join Date
    Nov 2003
    Posts
    248

    Default

    Nope Shawn it;s not related, just wondering why it wouldnt work on the server,when it worked on my localhost.

  4. #4
    Senior Member
    Join Date
    Nov 2003
    Posts
    248

    Default

    Hi guys I would like to know where to place my database folder.

    Locally there's a folder in mysql/data/ - where all your databas folders are placed - so that the php pages can connect to it.

    I cant find the folder. - Pls help

  5. #5
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    Firebirdfan.

    I'm not sure if I understood what you are doing (your original question made no sense to me) but now I think that that you are trying to upload the mysql datafiles from your local computer onto your Westhost server (that is, the "myd,myi,frm" files from /var/lib/mysql/).
    Is that right?

    It won't work. MySQL doesn't work like that.

  6. #6
    Senior Member
    Join Date
    Nov 2003
    Posts
    248

    Default

    Yes, I've uploaded those data files into the same folder of those PHP files that calls out from the data files.

    Locally on my desktop with Apache mysql & php installed I can get it working , as I place the data files into the mysql bin folder.

    So now on the server I can't find the mysql bin.. therefore my php files cant access the database & hence the error - can pls advise where do i place the data files ?

  7. #7
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    It won't work. MySQL doesn't work that way.
    You cannot just copy MySQL data files from one computer to another.

    I don't have time to go into at the moment (gotta rush out) maybe I'll get back to you later....

  8. #8
    Moderator wildjokerdesign's Avatar
    Join Date
    Jun 2003
    Location
    Kansas City Mo
    Posts
    5,720

    Default

    When I move database files I use phpMyAdmin between accounts on WestHost. You can "save" and download them on one account and them upload them on the other all via phpMyAdmin. Not sure if that is where jalal was going or not.

    You can also upload or add to a database file from a text file on your computer using phpMyAdmin. You might want to see if phpMyAdmin can read the database files on your local computer. I have a feeling it may be able to but not sure. I know I keep harping on phpMyAdmin but it is the only way I have found to work with databases without really diging in and learning all the tecnical stuff behind MySQL. I am learning some but for now it lets me get things up and running in via a browser enviroment.

    If I am completely off on what you are doing please just disregard my post.
    Shawn
    Please remember your charity of choice: http://www.redcross.org

    Handy Links: wildjokerdesign.net | Plain Text Editors: EditPlus | Crimson

  9. #9
    Senior Member torrin's Avatar
    Join Date
    May 2003
    Location
    Vista, CA
    Posts
    534

    Default phpMyAdmin vs. Actual mysql data file

    Yea, I'd think it would work if you go through an interface like phpMyAdmin. I think Jalal is saying you can't copy the actual data file that mysql stores the data in from computer to computer. I haven't tried it, but that's probably true.

    Quote Originally Posted by wildjokerdesign
    I know I keep harping on phpMyAdmin but it is the only way I have found to work with databases without really diging in and learning all the tecnical stuff behind MySQL. I am learning some but for now it lets me get things up and running in via a browser enviroment.
    I agree, I tried reading through the manual earlier this year. Unless, you're trying the become a database administrator, I don't recommend it.

  10. #10
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    Well, just to clarify my rushed statement earlier.
    You can, in theory, copy the .myd, .frm etc files from one computer to another, but then you have to find a way to let MySQl know that they are there, what permissions to grant them and so on. Its hard work, and MySQL provides a much easier way.

    On your local database, export all the data as a SQL text file, upload the file to your web site, create a database and import the files into the database.
    Now, Unix gurus with beards and sandals will just do all this from the command line, using the MySQL client 'mysql', using something like:
    $ mysql -u mydomain -p mydatabase < export.sql
    (should you be interested)

    But as Shawn mentions, there is an even easier method and that is to use PhpMyAdmin to do it.
    Export the file from the local computer (go to the database in the menu on the right, there will be a tab on the top of the page named 'export', go there, select the table(s) you want, make sure you have 'SQL' checked, and export it to a text file on your local disk).

    Next, go to PhpMyAdmin in your website, create the database that you want to load the data into (or use an existing one).
    Go to the tab marked 'SQL' and there should be a text box there called 'Location of text file'. Enter the location of the text file that you just created (use the browse button) and then let PhpMyAdmin upload the file to the server and insert all the data and so on into the database.

    Finished!

Posting Permissions

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