#1
  1. No Profile Picture
    A Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    dk
    Posts
    267
    Rep Power
    17

    Uploading a mysql db: Putty or FTP?


    Hi there.
    Sorry if this is a common question among beginners but i've got a bit confused.

    I have made a mysql database, and am using perl/html to access it. So far its all been done under localhost on my machine, using Apache as the virtual server.

    The database i made has no username/password when i connect using the DBI perl methods. (I don't want one particuarly, as i'm just experimenting)

    I need to know how to upload the database from my machine to the server. I used Ws_FTP to transfer the scripts fine.
    I hear all this talk of mysql dump etc, but i don't understand.
    I assume you can't copy the database in my data folder over to the data folder on the server.

    In english, where do you start from? I have Putty, which i use to change the login password for the account on the server, but other than that i don't use it.

    Once the database is on the server .... do the username/password change to access it. As i said earlier, when i use it on the local machine, there are none.

    Thanks for any help. Sorry if its seems like a stupid question, but so far the usual documentation has got me confused.
    The server is Linux BTW

    cheers
    Rob
  2. #2
  3. Senior Member
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2000
    Location
    Enschede, The Netherlands
    Posts
    1,527
    Rep Power
    16
    There are several ways to put a database from one server to another. Easiest is to make a dump of the database (either from the command prompt or by using some tool like phpMyAdmin). This dump consists of your table structure and your actual data. Next step is to move the dump to the other server. Again, several options. If phpMyAdmin is installed on the remote (target) server, you can import the file there I believe. Or you can ftp the dumpfile to the target-server with a ftp-client and use telnet or SSH (putty can do both) to import the dumpfile in the remote database-server by using the command prompt again (something like 'mysql -u user --password=abc < dump.sql' or 'mysqlimport ....', don't remember exactly )
    I assume you can't copy the database in my data folder over to the data folder on the server.
    Most of the times I wouldn't do that. Different databaseserver versions, or maybe different databases may exist on both servers. If you want identical databases and users on both servers and the filesystems on both servers are identical it *might* work (not sure). I'm on Win2000 and simply backup my data directory. If the systems crashes I simply copy the data over my fresh install and as far as I can remember it worked so far

    Hope this helps a bit
    There are 10 types of people in this world - those who understand binary and those who don't...

    PHP | MySQL | DevShed Forum Search | Google Search
  4. #3
  5. No Profile Picture
    A Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    dk
    Posts
    267
    Rep Power
    17
    Thanks.
    That's makes the process a lot clearer. I too, use win2000 and found copying the database into DATA dir worked fine for backing up etc. As the database is to be populated from the website itself, it should make uploading it much simpler, as the file size is next to nothing.

    Does anyone know of a site containing the commands for Putty. Their own website didn't help me out much.

    Anyway thanks for clearing that up

    Rob
  6. #4
  7. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
    PuTTY (I believe) open only a terminal on the remote machine, you should use ftp to transfer the files, eventually move them to the proper dir with PuTTY.
    Hope this helps
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    361
    Rep Power
    13
    Does anyone know of a site containing the commands for Putty. Their own website didn't help me out much.
    rob46,

    what i guess you mean here is: "once i've got connected to the remote machine thru putty, how do i do stuff?" i assume this as "the commands for putty" itself do not amount to much - you just have to select port (22 for ssh is the most secure choice if you have the option), put in hostname and connect.

    once you are connected, you get a "login as:" prompt, after which you likely have to enter a password. after this point, you're not "in Putty" as such - you are "in a shell" - the type of shell depends on the machine, the administrator etc. a lot of servers these days are run on linux, which often has a "bash" shell.

    on my linux machine, and maybe on your server, typing "echo $SHELL" will tell you your shell.

    so you need to be looking for "bash shell commands" in google. instead of bash, you may find "tcsh", "sh", "csh" or others.

    some commands to get you started - try cd, ls, vi (potentially scary - type esc then :q to exit if you get lost), df, top, clock, chmod. if you need more details on a command, type commandname --help or man commandname.

    hope i've understood you right, and hope this helps...
    Little more than a playground for the bugs that live beneath us...
  10. #6
  11. No Profile Picture
    A Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    dk
    Posts
    267
    Rep Power
    17
    Yeah, thanks for that.

    I understand it ok. I'll playing around with some of the commands you suggested!

    Thanks very much

IMN logo majestic logo threadwatch logo seochat tools logo