Where and how do i upload my database files?

I am unable to find the phpMyAdmin panel so as to upload my database files. I was hinted that i could import my files through the CLI with the command (below) after i have uploaded my sql file in the home directory. mysql -u root -p $database

I have done so much and on entering the command, it displays a ‘Welcome to SQL monitor’. However, after that, i am neither able to upload my db files (if they aren’t already there). And if they are supposed to have been uploaded with that command, then I’m unable to see the tables and data. Also, my site isn’t working. So , how exactly do I upload my db files?

Could someone please help me out? Does it require me to install phpMyAdmin somewhere first? (I am using a Windows machine.) And if so, how?


I want to upload a database file to my phone how can I

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You will first want to upload your .sql file to your droplet using an SFTP client like Filezilla. Then, in the directory where your .sql file is located you can run

mysql -u username -p database_name < file.sql

to import your database’s tables and data. This will only populate a database and not create one so if you have not yet created the empty database you will need to do so with:

mysql -u username -p

This will get you to an interactive mysql shell. You can then run the following to create your database.