By levan100
Hello Everyone
I want to get (export) mysql database , i cant use this url http://site.com/phpmyadmin because does not exists i have already installed phpmyadmin in terminal but there is nothing, so i decide to export database from terminal , do anybody knows how to export mysql database from terminal
i used this code mysql -u [username] -p newdatabase < [database name].sql
maybe a database exported but where is that files location dont know :/ i want just sql file
thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @levan100
The code example you’ve supplied is for importing data - not exporting.
You should use mysqldump, since it tries to do the data dump without blocking the database tables.
mysqldump -u [username] -p [database-you-want-to-dump] > [path-to-place-data-dump]
So it could be something like this:
mysqldump -u root -p mydatabase > /home/myuser/database-dump.sql
Then the database dump would be /home/myuser/database-dump.sql
You can read more about mysqldump here:
https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.