1. Localhost is a common connection in shared hosting environments. You can double check with Bluehost, but I believe they use localhost.
2. Not 100% sure what you are asking here.
3. DW can handle multiple database connections, but why do you need to connect to multiple databases? This is more a question of database design then it is about the data.
To go back to your original issue, a 500 error can be a result of a few causes. One is bad htaccess file so if you are doing rewriting of URLs check that. Also, check your error logs on the server (your host can tell you the location) and that can shed some light on what is causing the 500 error.
Thanks for the response. Very much appreciated!
1) Based on your response, looks like I just keep the server name as local host, but just change the username and pword to match my remote user profiles?
2) Re-reading this question, I guess I'm wondering what are some good practices when transitioning from local to remote? I would assume things like keeping username/pw for local, remote the same, using import/export the same. But I was more focused on the transfer of the DB connections that function on local to the remote. I'm finding that its not as simple as just transferring the site, importing/exporting the DB.
3) Sorry, wasn't clear on what I meant by multiple databases. It was in reference to connecting to both the local and the remote. This would be in the 'Database' window. So then I could run RS against either DB?
Thanks for the direction on the error log. I think I know where it is on the cPanel, so hopefully that will shed some light on the issue.
A final question...When I am testing the site locally and running recordsets off the local db, when I publish to remote, do I have to rewrite the record sets to reference the remote db? ?Or do I just change the DB connection information to access the remote as opposed to the local?
Thanks for your patience!
Firstly, you may not realize it but Dreamweaver has you using the ancient mysql extension, which NO ONE SHOULD EVER USE ANY LONGER. Use the Mysqli extension or PDO. However, it makes sense to go ahead and verify that you CAN connect to the external DB first. In other words, solving problem 1. And for this issue, I don't have any suggestions.
2. Typically you have a file outside your web root (looks like you've done that ...Connections) that provides the database log-in. This file can be very different on the local system from the external system, but as long as they use the same file name, you don't have to keep track of them. One thing I do is set verbose error messages on for the local system and no error messages for the external system.
3. Be aware that there is a security issue when doing this. Normally you don't want to let your external DB connect outside the server through http. Your webhost may not even allow it. In cPanel, see if you have an option for REMOTE MYSQL. You can enter the ip address of your internet connection here to allow the DB to communicate with your local system.
I don't use the DW database tools just because I prefer to write all my own code and do things my way, so I don't know if you can do this through the DW database tools. But what I do is simply export the external database (as SQL) and replace the local DB with it. This allow you to make changes to both structure and data without being concerned that you are going to mess up your live database.
I was somewhat stuck because I couldn't understand that when you create the site locally, how do you get it to work online. When I created the DB locally and had usernames and pwords to access, it worked fine. I thought that I could 'preview' the remote site in dreamweaver, which can be done, but takes a bit of work around (create new DB connection, add your IP to remote access list, etc). So I was stuck trying to 'preview' my site on my machine, which won't happen because the hostname should be 'localhost' even on the remote. This is because the website AND db are running on 'localhost' because my host (Bluehost) runs off 'localhost'. So I could never 'preview' the remote site due to the db running "locally" on the remote.
With Bluehost, they automatically change a few things:
- Bluehost places certain characters in front of any username and the database. So when I export from local and import to remote, my DB went from "TBO_Golf" on the local to "(Bluehost characters)_TBO_Golf" on the remote.
- The username and pword combo I was using on my local test had to be changed to match my remote credentials. Bluehost limits the amount of characters on usernames and places specific characters in front of any username. So I had to change it from "(Local username)" to "(bluehost inserted characters)_(username)" and matching password. I could have left it and it would have worked, but every time I wanted to update, I would have to change the username/pword combo every time I went from local to remote and vice versa. So I'd rather save myself the headache and just change the local to match.
- So, when I uploaded the site to the remote, the only thing I had to do was update the DB name. I went to the website and 'TA-DA!!!' My dynamic pages now work!
Thanks so much to SnakeEyez02 and Rob Hecker2 for their help!
Any suggestions as to where to go to get some more knowledge on using a more up to date mysql connection?