localhost as mysql database host not working upon wordpress install

Avatar
  • Answered
hi, i am trying to duplicate a wordpress website, but facing error of database host, i am trying to put localhost as database host but its not working, can you please guide me what should i use as host for creating mysql database connection.
Avatar
Tim S.
Hello, Thank you for your question about databases and WordPress. I'm happy to help you. Localhost is the correct hostname for the database if you are connecting to a database on the same server. If you are trying to connect to a database on a remote server than use the domain name. Keep in mind, after migrating the files from the old server, you still need to set up a database in cPanel and import the old database information. I hope this helps! Let us know if you need anything else. Gratefully, Tim S