How to reconnect from workbench to heroku app? - mysql

I have made a React+Node application with 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 connected the database to the app. But after a while i changed (on PhpMyadmin) the database structure and i deleted the connection from workbench panel. I tryied to make a new connection with the same Config Vars but the workbench send me an error of "Unknown Database nameOfDatabase".
There is something i missing? there is anything i have to do to delete the old connection for the new one to work?
thanks!

Related

How can I connect my sql (workbench) to mysql server (bluehost) to activate a CRM system?

I've tried using sql workbench to connect to mysql bluehost database and then migrate the data I have in the tables to the tables on my bluehost server, so I've created a subdomain to upload the CRM zip file and install the CRM on it.
So I've tried multiple ways to connect them together, created a new IP on bluehost to connect it to the workbench but it never gets connected I am not sure why, I've tried connecting the sql workbench to the localhost, it worked but I can't get to upload the zip folder (42mb) to the localhost and install it to make the CRM work and then migrate the data of the clients and customers on the CRM database.
my workbench is now connected to my localhost (root) but it gives me connection warning, not supported even though I've tried the ctrl+R for reverse engineer database and it worked at first to create the connection but then it does not run smoothly, it is still not supported.
So I want to either be able to upload the zip file to the localhost to install the crm and then migrate the data to it, or be able to connect my bluehost server to the sql workbench I have on my pc (knowing that the CRM is already installed on my bluehost just missing the data of the clients)

How to switch from MySQL to Postgre on Heroku

I want to host a django project on heroku. Locally, I developed it using MySQL database. And I have also pushed it to heroku but I get an Error message whenever I run heroku open command on command prompt. The error message is Can't connect to local MySQL server through socket. Though I'm a newbie in using databases, the way I understand the error is that heroku can't connect to local MySQL server which I'm using for local development. I don't want to connect to a remote MySQL database, instead, I want to connect to Postgre database just as heroku recommended.
Being a newbie in the use of database, I don't know the best way to migrate to Postgre or how to add MySQL in my project to .gitignore. Is it possible for me to start running Postgre on heroku while MySQL isn't added to . gitignore and is still the database in settings.py? Must I clear MySQL database or add it to gitignore before I can use Postgre?
PostgreSQL settings for Heroku:
Please install dj_database_url using below command:
pip install dj-database-url
In settings.py , import dj_database_url and add below settings at the end of the file:
import dj_database_url
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
Done !! Now, deploy again to Heroku.

MySql workbench not responding w local server

I have been using MySql Workbench to connect to a local MySql server and to remote MySql Servers. The last couple of days the Workbench freezes when I connect to the local version. It still works for the remote servers.
I am using workbench 6.3.4 and then tried 6.2.5 just to see if it is a version issue.
I also can access the local MySql instance using HeidiSQL.
Any recommendations on what to look for?
Update
The advice to recreate the connection solved the issue. I just created a new one and it works fine.
A couple of things you can try:
Try restarting the sql server (remember, workbench is just a utility for accessing a db, it does not host the database for you)
See if you can access mysql on the command prompt / terminal, the command for mac & windows
(once you navigate to the mysql folder, try the command:)
mysql -u root
(if you have a password-protected account, the command will be
mysql -u someuser -p
If the above doesn't work, mysql is either offline or denying you access (depending on response), and you'll need to setup the server / assign privileges.
If all else fails, it may help to try another version of SQL / Workbench (for a easy-to-use sql sever setup, I'd recommend WAMP or MAMP, assuming you want a HTTP server bundled with it)
Additionally, it may help to recreate the local connection in workbench (of if your getting regular crashes, reinstall & update workbench). Good luck with it.

How to push my Mysql database to heroku via mysql workbench?

I have created cleardb on heroku, I want to push my mysql database on local disk to heroku. I have mysql workbench installed. How can i push it to heroku ?
look at the output of heroku config - you will see an key called CLEARDB_DATABASE_URL this is the connection string your application uses to talk to your database.
You can take this URL and break it up into it's constituent parts to get a username, password, host, port and database name which you can use in a connection via mysql workbench.
See https://devcenter.heroku.com/articles/cleardb for further reference.
If u want to just push your database, use console, it's simple:
heroku db:push

Grails DataSource for remote MYSQL database access and migrations

Is it possible for locally running grails application to access and update remote MySQL db?
Assume the remote server is linux on which tomcat, MySQL are installed in the usual places.
Assume remote URL is accessed as tom#189.124.24.249. So grails needs to access the db as the user 'tom' or does it need to be the root user or mysql user??? Does the password of user tom need to be specified in the DataSource.groovy? In MYSQL the db test_db is configured to be accessed with user name 'guru' and password 'secret'.
If the same grails application is also running on the remote server accessing that remote db, a locally running instance of grails application accessing the same remote db should not cause any problems??
Assume the remote db name is test_db.
I need this also in context with liquibase grails plugin and database migrations. I need to run grails migrate command against the remote db to synchronize it with local db.
A side question: how do I synchronize local db in which table data is already populated to remote fresh newly created db with no data? This seems to fall under the domain of db content migrations which is not covered by the grails plugin as far as I know. I would like to know what would be the correct approach to this in the context of a grails application.
you just need to set the proper credentials in the Datasource.groovy and it all should work fine. We are running our app in a production environment and the database server is on a different box.
I dont think that two applications accessing the database server should be a problem.
Can't help with the side question... sorry
I believe, it's mostly a duplicate of Liquibase Grails database migrations
For side question: after Grails migrates structure, mysqldump or whatever backup/restore procedure should work.