1

I'm using putty to connect to my MySQL server.

I've a backup .sql file from which I want to create the tables on the server.

According to the link here restore backup mysql, I'm trying to perform this command

mysql -u username -p -h hostname databasename < dumpfile.sql

Now my question is,

  1. What is the 'hostname' here? Is it 'Localhost'?
  2. How do I find the correct path to my dumpfile.sql file on the server which I have uploaded. Say for instance I've uploaded inside www/apache/appname/?

1 Answer 1

5

If you are logged on to the machine where MySQL is running, hostname is indeed localhost (but if you leave it out, localhost is assumed). For the path to dumpfile.sql you can just provide the full path including all folders. Your question shows a relative path www/apache/appname/. I assume that you meant that to be an absolute path starting from /. If that's the case, the whole command would be

mysql -u username -p -h localhost databasename < /www/apache/appname/dumpfile.sql
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.