Page 1 of 1
Transferring local database to server
Posted: Wed Jan 21, 2004 1:24 pm
by coindood
I have created a website using php and mysql with lots of scripts accessing a msql database at 'localhost' and using the 'root' database account with no password. In all the mysql connect statements, what would I do to change them when I upload it onto the server and work, like what would I change the host to?
Posted: Wed Jan 21, 2004 2:37 pm
by xisle
localhost will work fine if the MySQL account has access to 'localhost'.
You would use a different host if the php scripts were on a different server than the database.
You'll want to create a new MySQL user account for your site for security reasons (do not use root), only grant permissions to that user that are necessary for the site to run.
http://www.mysql.com/doc/en/GRANT.html
Posted: Wed Jan 21, 2004 2:40 pm
by jaxn
If the database is running on the same server as the httpd (probably apache) then you will still use localhost, though you may have to change the username and password params.
-Jackson