I have tried to install Let's Encrypt free SSL and somehow I messed up my whole server.

I have 2 websites on it, a Wordpress blog and some really small website that I use for practicing php. Anyway, PHPmyAdmin gives me 503 error and I found

mysql -p -u username database_name < file.sql

to move databases to /root/.

Now how to download them from here? I can't use SFTP as it says "server don't support". My question is, is there a command to download using PuTTy to my PC.

  • the.earth.li/~sgtatham/putty/0.67/htmldoc Look at chapters 5 and 6 to see if this helps. – closetnoc May 2 '16 at 14:10
  • Thanks for your answer. But I can't make it work. I used exactly this lines *pscp administrator@serverip:/root/administrator_db.sql/ d:\temp* what I did wrong? – Cosmin P May 2 '16 at 14:38
  • I have never used these options and my copy of PuTTy is old enough not to try. ;-) You can always use cp (man cp for help) to copy the file from the /root/ directory into the sites web space. I suggest making the target name simple. From there, you can just make an HTTP request from your browser. I had to do this recently when FTP and other options kept failing. It works fine, but not as convenient. This is assuming that the web server is still working. Otherwise, you may need to use FTP or e-mail. computerhope.com/issues/ch000817.htm may help. – closetnoc May 2 '16 at 14:48
  • Might help to have more info. How is your server messed up? Did you look through any error/message/audit logs? What do they say? Is your webserver running? Are there any crash/service-restart logs? Is ABRT sending reports? This line you posted is to import a db dump. To download files you can use cp or rsync with "preserve permissions" args to temporarily copy stuff to a publically accessible directory (like inside www or public_html) – dhaupin May 3 '16 at 19:57
  • My server was up and running but the websites on it were down. The error I got was something like etc/httpd/conf.d/letsencrypt.conf: No such file or directory. I wasted a couple of hours finding the solution, need to say that I couldn't restart my server because of said error. Anyway I reinstalled CentOS 6 on my server, used the back-up databases and downloaded my site via FTP, in 20 minutes I was back. I am pissed that I couldn't find the answer. And cuz I don't have the green lock. I like green locks. – Cosmin P May 5 '16 at 8:36

The command that you used does not export the database. It imports whatever was in file.sql into the database. The < points from the file to the database.

If you want to export your database into a file, that you can download, you should use:

mysqldump --opt -p -u username database_name > file.sql

Note that the > points towards the file, and it is using the command mysqldump.

That file will usually be created in your home directory and can be downloaded from there.

If you want to create it somewhere else, you can specify the full path:

mysqldump --opt -p -u username database_name > /home/my_unix_user/www/file.sql

When you know exactly where the file will be, you can then get it using SFTP.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.