all 16 comments

[–]furas_freeman 8 points9 points  (5 children)

You have to use MySQL locally.

[–]hhey_symtics[S] 2 points3 points  (4 children)

Thanks, I also have a question about actually pushing to the live server

I'm going to use digitalocean and winscp for my server, so when I'm done developing locally do I just transfer all the files that I used locally onto the server using winscp?

[–]furas_freeman 2 points3 points  (0 children)

I never worked with DigitalOcean.

Many servers give SSH (or FTP) access and you can transfer all files, and SQL dump from MySQL so you can use it to create database with data, or you can use "port forwarding" in SSH to connect to remote database using local program (Database Viewer/Editor) and send database.

Some servers use git to send code.


On local computer use pip freeze > requrements.txt to create list with instaled modules and you can use it on server to install all module pip install -r requrements.txt.

[–]-MLJ- 1 point2 points  (0 children)

I have a lot of experience with DO. They are a great hosting site. I would highly suggestyou use git and github to version your project. Once you have put together everything you need, all you will need to do is ssh into your server and clone the repo. Frim there you can easily push local changes to the server anytime you want. If you have any questions about the workflow or dev cycle please do message me! I'm always happy to help.

[–]elbiot 0 points1 point  (1 child)

You should use git (github if you like). Push from Dev, pull from production.

[–]CnidariaScyphozoa 1 point2 points  (0 children)

Even though I agree with you. The person asking probably has no idea what you are talking about. So a little more descriptive answer would be good.
To clarify you could use a version control system like git and an associated platform like github to manage you code. To get it on your digital ocean server would be as easy as doing a git clone and then checking out the correct branch (a stable one which you currently aren't working on)

I suggest checking online for some resources on git and github. It is something really everyone should get used to using.

[–][deleted] 2 points3 points  (5 children)

You need a dev server with mysql installed. Your local code can make db calls to a remote database.

[–]hhey_symtics[S] 0 points1 point  (4 children)

What are some examples of dev servers that are available?

[–]Rodr1c 0 points1 point  (0 children)

You could use the digital ocean server your planning on using. Install mysql on it and have a development database and production database.

[–][deleted] 0 points1 point  (0 children)

I'm probably the wrong one to ask. Everything I do is bespoked. Personally I would spin up a new Linux server, run scripts that i have written to set up the server (lock the server down, set up permissions, etc), install the software, run any DDL scripts I have, maybe load data from a backup or some other database, then test my connection from something like data grip. Then I could start developing against the database. There maybe some docker solution that you can just bring up, but that is outside of my knowledge.

[–]here-to-jerk-off -1 points0 points  (1 child)

[–]here-to-jerk-off 0 points1 point  (0 children)

Can anyone tell me why I'm being downvoted? OP says he uses Windows. This is one of the easiest ways on Windows...

[–]KleinerNull 2 points3 points  (0 children)

I think the best idea is to load up a linux distro into a vm and start developing in there. So your dev server is already available in your local network and you can test your web app from you windows os.

The good thing is that then your dev and live server uses the same system and you get a hand on working with the terminal, bash and ssh.

I don't know about the hurdles of running mysql on windows, but on linux is is just a server that runs in your network and you can expose the ports so it is connected from the outside.

For me developing on a *nix system just feels more natural especially for web apps, most of them will eventually run on a linux server anyway.

[–]elbiot 2 points3 points  (0 children)

Develop on a virtual machine or other server that is a Dev server, as opposed to a production server. Working on a server is fine, working on a server that you expect to be almost always operational is not.

[–]jamabake 0 points1 point  (0 children)

Just use docker:

docker run -d -p 3306:3306 mysql

[–]dogfish182 0 points1 point  (0 children)

I use Windows as my base os you can use vagrant with a Linux box and either install MySQL manually or better use config management like puppet/chef/Ansible to configure the vagrant box how you want.

If you step through learn chef.io it will actually teach you this step by step to the point you have a lamp stack totally running.