MySQL Workbench with Heroku - php

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.

Related

How to Synchronize mysql database to update from localhost to online server

I'm trying to make an Application that Runs in Localhost.
In the end of the day, I need to update my online database by data from my local database and I have NO idea how to do that.
can anyone tell me how to do that...?
I'm using codeigniter to make this app.
First, You should know How to Connect to the MySQL Database Remotely and How to allow remote connection to mysql than you can use syncr to synchronize your mysql databases

upload mysql DB from my localhost to Heroku Clear DB

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.

How to insert google addsese into MySQL database using PHP mysql

I want to insert Google Addsense code into Mysql database using php mysql in the live Linux server. But its not inserted, actually Google Addsense code inserted into my local Mysql database in my local system, but not in the server. Since Google Addsense code is a javascript code, may be due to this its not inserted(Normal data inserted), please help me how to insert such type of data into database.
Addsense code inserted into my local Mysql database in my local
system, but not in the server
Looks like you connected to database on your local machine instead of wanted server.
Acording to http://php.net/manual/en/function.mysql-connect.php
mysql_connect('<<<IP ADDDRESS TO YOUR SERVER>>>', '<<<USERNAME>>>', '<<<PASSWORD>>>');

Azure with ClearDB

I have a php project that is connected to a ClearDB database. Running it locally has no issues and is able to interact with the database. But when I push the project to azure and try to run it from the website, it does not work with the database correctly. It seems to be able to connect to the database but inserts almost blank rows. For example, when I try to "register" it creates a row in the Users table with an ID but the name, username, etc. is all blank. I have no idea what is causing this. Are there any settings I have to change in Azure for it to be able to use that database or anything?
Thanks!

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