January 6th, 2003, 08:09 PM
Uploading a mysql db: Putty or FTP?
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
January 6th, 2003, 09:09 PM
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 )
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
January 7th, 2003, 05:07 AM
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
January 7th, 2003, 05:35 AM
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
January 7th, 2003, 11:06 AM
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...
January 7th, 2003, 11:18 AM
Yeah, thanks for that.
I understand it ok. I'll playing around with some of the commands you suggested!
Thanks very much