: How to download a dump of the mysql database from the server's /root/ 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
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.
More posts by @Shanna517
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.