By samsoft
I’ve an instance server running (Scheduled) a scrapy application on another cloud service, also have another instance on DigitalOcean running the user interface (Flask Application to be precises) with database configured, How can i connect database on Digital Ocean to the Scrapy application running on another cloud server?
Note: The main reason is to allow the data scrap by the scrapy to be inserted into the database on digital ocean, please how can i achieve this. Already have mysql database install with phpmyadmin on DigitalOcean
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
By default MySQL does not allow remote connections and does not include a user account with permissions to reach the database from the outside. This can be adjusted fairly easily.
1.) In /etc/mysql/my.cnf modify the bind-address variable by either 1.) commenting it out or 2.) changing it to 0.0.0.0. Doing either of these will now allow outside connections.
2.) Next you’ll need a user that is authorized to access the database from a remote IP.
GRANT ALL ON database_name.* TO user@xx.xxx.xx.xx IDENTIFIED BY 'your_password';
the xx.xxx.xx.xx should be the remote IP address you will be accessing the database from. This can also be set as a wildcard to allow the user acccess from any IP but generally this is not a good idea unless the server connecting to the database has a dynamic IP or cannot be predicted for another reason.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.