Transferring local database to server
Moderator: General Moderators
Transferring local database to server
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?
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
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