Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting will result in a timeout from the forum.
In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.
First, I'm not familiar with Mega, but using pins 0 & 1 for software serial might be wrong. Are those pins used as a hardware serial port as in the UNO and Nano? Try another pair of pins.
Second, I didn't think 9600 is the baud rate for the HC-05 command mode. Isn't it a higher value? The default operational mode (as opposed to the command mode) is 9600.
Do you know how to put the HC-05 into command mode? You keep the button pressed while connecting power.
It will work for you once you've got everything right. The serial terminal app will work to both send & receive text and send AT commands, when the HC-05 is in command mode. Then you can build your own apps.
When you have four (4) hardware serial ports, using software serial on a Mega is a seriously dumb idea. I cannot believe an example for that stated purpose would actually be included in the IDE, but there you go... About the only thing dumber would be to use software serial on the hardware serial pins 0,1, or any of the other hardware serial pins for that matter. Depressing results are guaranteed, and it just goes to show what dangerous junk you can get off the Internet although, on reflection, I can't help feeling that you have made some illicit changes.... Further, if you simply wish to connect with the phone, you don't need to send any AT commands.
You might find the following background notes useful.