upload mysql DB from my localhost to Heroku Clear DB - php

I create an app in heroku with the ClearDB add-on and PHP as language. Following the Heroku-ClearDB documentation guidelines I try to upload and existing localhost-DB created in MySQL with PHPMyAdmin ->
I execute in the console:
heroku addons:add cleardb:ignite --fork=mysql://user:pw#localhost/db_name
and everything looks fine but when I go to my app in heroku and I select the DB in the Dashboard the DB is empty.
What I am doing wrong?
Thanks.

I'm pretty sure the --fork option tries to download the database from the ClearDB side and it can't get access to your local database - it's designed to fork databases from a globally available location.
You should copy the database manually via dump and restore as described in this answer: https://stackoverflow.com/a/7111224/6678.

Related

Working locally on an existing remote Laravel project linked with a database

I have recently joined a project that uses AWS EC2 to deploy a frontend in NodeJS and a backend in Laravel linked to a phpMyAdmin database. My question is simple but I have not found the way to do it despite litteral hours of research.
How can I launch the backend locally and use the corresponding database?
I should add that the database seems to be automatically generated by the Laravel backend and it contains a folder of "mutations".
I am relatively new to php, VMs and Linux overall.
Thank you for your help
This project is probably using mysql or mariadb as database engine.
You must install the engine and export all of data from server and import it in your local database.
If database is on server and you want to connect to that database, it depends on security mechanisms. You must expose the db engine's port in the server and changing your laravel config to use that host for database connection. But I don't recommend that!
If you just want to run backend for personal tests, just setup backend and database engine and run migrations. I can't help you with this step cause I don't know how are deploy operations in your team. If you provide more information, we can help better.

Installing OctoberCMS on Azure

I have created an App Service and SQL Database(created new & blank sql db) on Azure to install OctoberCMS. I have got as far as the Database install page and after inputting my credentials I created earlier when creating the DB and I get an error saying my new database is not blank.
Database "DatabaseName" is not empty. Please empty the database or specify another database.
There is a problem with the specified Database configuration.
I have been playing around with various configuration bits on azure for quite a while now and I'm just tearing my hair out trying to work it out. Any help would be greatly appreciated and if any more info is needed let me know.
I was able to install to Azure Web App and Azure Database for MySQL. High level steps are:
1. Create Azure Web App, ensure App settings are set to use PHP 7.0 or
higher
2. Deploy code through Kudo Zip Deployment (or whatever method you are comfortable)
3. Create Azure Database for MySQL
4. Browse to Azure Database for MySQL -> Connection Security
5. Click + Add client IP
6. Allow Access to Azure Services = ON
7. Enforce SSL Connection = DISABLED
8. Use whatever tool you like to create MySQL DB, I used MySQL Workbench.
9. Browse to https://<yourwebapp>.azurewebsites.net/install-master/install.php
10. Use info from Azure Database for MySQL -> Overview to fill in DB values
Reference:
https://learn.microsoft.com/en-us/azure/app-service/deploy-zip#deploy-zip-file

MySQL Workbench with Heroku

I have made an application with CodeIgniter with a MySQL database. I'm using Heroku to deploy my application, and have done so successfully. However, I'm having problems with using my database on Heroku. Locally I'm using XAMPP and phpmyadmin for all database work.
In Heroku, I've used a clearDB add on to support MySQL and have gotten all necessary credentials in the format:
mysql://DB_USERNAME:DB_PASSWORD#BD_HOST/DB_DATABASE?reconnect=true
I've used MySQL Workbench and have created a database using the above supplied host name, username, password and have successfully imported the tables, columns and data from my already existing database.
Now, I'm unsure on how to proceed. Do I export my database from Workbench? or what am I supposed to do to be able to use my database on Heroku.
Any and all help appreciated. Thanks.
P.S. please don't tell me to use Postgres
Update: So I figued I didn't have to do anything, once the databse is configured on Workbench, all I had to do was refresh my heroku web page and it works.

Wordpress Duplicator Installer on Heroku

I've built out a wordpress website locally and now I'd like to deploy it from localhost to an actual web address hosted on Heroku.
I've created a new sql database on my newly created Heroku site and am using the Wordpress Duplicator plugin to transfer everything over.
I've pushed all my files onto heroku master, and I've installed the Duplicator installer.php and .zip files.
However, when I actually try connecting to my Heroku data from the installer, it pauses for a while and gives the following error.
"An error occurred while testing the database connection! Contact your server admin to make sure the connection inputs are correct!"
Am I missing something in regard to connecting to Heroku databases externally? What's the best way to get wordpress up on Heroku?
Note that the SQL connection string for your app deployed on heroku is very definitely not localhost. In particular:
If you've been using mysql for local deployment, you will need the ClearDB plugin added to heroku; instructions on how to optain the endpoint for the ClearDB database are here: Remote connect to clearDB heroku database
If you're planning to deploy wordpress using the postgresql database, you need to add the postgresql add-on, and configure wordpress to it. There's already instructions, and a full repo for wordpress-heroku that you may peruse
Hope this helps.

Updating a Google Cloud SQL Database instance

I have a deployed Cloud SQL Database instance running right now and it works fine. I am able to access and use it via my PHP Google App Engine app. I also have a local SQL Database for development.
Locally, I have made some changes to the structure of the database (added new columns) and would like to push those changes to the deployed app.
When I try to do this via the documented method on the App Engine site, I get an error saying the import failed for an unknown reason.
I am using a .sql dump made by PhpMyAdmin and have done this successfully for the initial import. I made sure to include USE DATABASE NAME in the dump.
Any ideas as to why it's failing? What is the best way to update a Cloud SQL Database? Thanks a lot!
An easy way is to request an IP, whitelist the IP you are connecting from (link) and use the MySQL client (link). Over IP you can also use GUI tools like MySQL Workbench, Toad, SQuirrel SQL and others (link).
You can set up phpMyAdmin as a different version of your application using the instructions here: https://gae-php-tips.appspot.com/2013/05/26/setting-up-phpmyadmin-on-app-engine/ That would probably be the easiest way of updating a Cloud SQL database...

Categories