mysqlimportplanetscale

How can I import local hosted MySQL database to PlanetScale


Am making a website, hosted on netlify, and i've made the database on MySQL workbench, how do I import it into my PlanetScale? to be live.

I've tried to watch the planetscale tutorial for that.

Can I do some command that can run to get me a file that can be imported?

Some usefull info: 1- I have it on workbench, so I cant really see the database files 2- My planet scale tier is the free one, so i dont know if i can import


Solution

  • They seem to have some instruction here on how to import data from a database that you have.

    https://planetscale.com/docs/imports/database-imports

    You might use some free tier hosting provided by a cloud provider to publicly host your db and then use this import client they have.

    Alternatively, you might simply run mysql-dump on your existing database to create a dump.sql file with your existing db, and then run that dump file with the mysql client of your choice pointed at your planetscale db to create the database.