Importing database using Sequel Pro

... by Bittle in Website Hosting December 26, 2018

Make sure to access your server via SSH before continuing.


To execute SQL code in the server run

mysql

We need a new user to access the database. We can create one by running

GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';

DON'T COPY PASTE THE ABOVE CODE! 'password' IS NOT A REAL PASSWORD! CHANGE 'username' AND 'password'!

Now we need to install a database management application, like Sequel Pro. Open Sequel Pro and add a new connection by pressing the + on the bottom left


Then click SSH and fill out the information:

  • Enter name for new connection
  • MySQL Host: ip_address
  • Username: username (from previous SQL command)
  • Password: get from /root/.digitalocean_password
  • SSH host: Same as MySQL Host (above)
  • SSH User: root
  • SSH Password: Click Key icon and import private key

Test the connection, add to favorites and connect


Once you're in you need to import a MySQL database (I've previously created a database in PhpMyAdmin with XAMPP). Click "Choose Database" on top left corner and select "Add Database"


Fill out the database name and click "Add"


Then import your SQL into your newly created database


And your final database view should look like


And there you go, our database is up on the server! Next we need to move your files using Filezilla.

Comments (0)

Search Here