How can I create a DB to my local drive?


#1

Instead of creating a DB within MySQL and C9 want to make sure that the DB is on my local drive.

This way if the server stops I don’t loose the data.

Please suggest best way to do it.

Thanks


#2

If your server stops, all the data in your MySQL database should persist, that’s the point of databases. If it’s not, you should probably fix whatever’s causing your data to disappear. That said, if you really want to set up your database locally, it’s going to take a fair amount of work. You’d need to set up your computer to act as a server, set up port forwarding on your router, and set up Dynamic DNS or get a static IP so you can connect to your computer. If it’s a laptop that you take elsewhere, forget it. If you have a server lying around, use it. That said, it’s incredibly dangerous to expose your network and computer, so please, do something else. If nothing works, try just backing up your database regularly, but AFAIK, there’s no reason the data should disappear.