Transferring local database to server

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
coindood
Forum Newbie
Posts: 11
Joined: Mon Jan 19, 2004 2:01 pm

Transferring local database to server

Post 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?
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post 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
jaxn
Forum Commoner
Posts: 55
Joined: Fri Jan 16, 2004 1:50 pm
Location: Nashville, TN

Post 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
Post Reply