I installed mySQL, php & Apache on my computer. I have set up my database, written my PHP, got things working… using the ‘localhost’.
I want to upload my database and php scripts to my web server.
Where do I put the mySQL files? Which files from my mySQL directory (on C:/mysql = 68MB). In what directory should I put them?
My php script calls:
$link = mysql_connect(“localhost”, “username”, “password”); Just when I upload…
I was thinking I replace localhost with ‘samblakeley.com/datbase’… please can you help. I think it might be a good idea to have a tutorial on this, unless it is something really simple
er… you can’t “upload” mysql onto a webserver, it needs to have it installed as u did on your pc…
or maybe if you just want to duplicate your database onto the webserver then I think you can export the localhost database to a .sql file and then use it to create the database onto the server but I only use phpmyadmin (whic I recommend) so I’m not sure…
My hosting server allows me to use PHP and mySQL… I have set up a Quotes database on my PC. It allows me to add/Delete quotes etc. I hope to create all my random quotes (www.samblakeley.com) from this database.
I know I have to upload my quotes database to somewhere. I would like to continue to edit that ‘live’ on my website. I just don’t understand whether I have to create a folder and add the *.sql file ( as you say)… I know where localhost is, I have to put a hostname or IPaddress… ?
Or should my hostname = “database/mydatbase.sql” (in a folder called database?)
I’m thinking that my service provider (webnames.ca) should be giving me the IPaddress to their mySQL server… ? And by using my usual userName and password I should have access to my own little folder to store my own databases/tables etc?
If you have access to phpMyAdmin, then you can export your database from there. It’ll be a large file full of SQL that’ll recreate your database. With or without the data - you have to select which when you export it.
Then on the new machine you create an empty database and go to the SQL tab. There you can upload the SQL and run it.
If you have shell access you can also just pipe the SQL into the mysql program.