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,
- What is the ‘hostname’ here? Is it ‘Localhost’?
- How do I find the correct path to my
dumpfile.sqlfile on the server which I have uploaded. Say for instance I’ve uploaded insidewww/apache/appname/?
If you are logged on to the machine where MySQL is running,
hostnameis indeed localhost (but if you leave it out, localhost is assumed). For the path todumpfile.sqlyou can just provide the full path including all folders. Your question shows a relative pathwww/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