Alter MySQL auto_increment with Heroku ClearDB addon - mysql

My Rails app is hosted on Heroku. I have a problem with MySQL incrementing by 10: Large Auto Increment IDs
I really want to change it to 1, and I have found the SQL command for that. However, I cannot figure out how to connect to mysql via Heroku to perform it. Is there a workaround? Is it even possible?

You can connect to the database hosted by ClearDB using your local mysql command line client application. First you'll need to check your database URL to get the necessary connection details, so run heroku config and you should see a line that looks something like this:
CLEARDB_DATABASE_URL: mysql://abcdef01234567:9876543#us-cdbr-iron-east-01.cleardb.net/heroku_fedcba76543210?reconnect=true
The URL contains the username, password, host and database name in the format:
mysql://username:password#host/database?reconnect=true
With those four pieces of information you can connect to your database. Using the (made up) example database URL as an example:
mysql --user=abcdef01234567 --password9876543 --host=us-cdbr-iron-east-01.cleardb.net heroku_fedcba76543210

Related

Is there a way to create databases and tables in jawsdb on Heroku deployed app?

I've deployed this homework app locally. It works fine, locally. Once I deploy it to Heroku, and view the logs, I see
Error: ER_NO_SUCH_TABLE: Table 'jzg04w8rh30864yk.burgers' doesn't exist
I've used MySQL Workbench to connect to the Heroku db successfully, but I'm not allowed to even the SELECT command. Workbench tells me:
Error Code: 1142 SELECT command denied to user 'cvhl3g86ycqw6hse'#'96.42.208.204' for table 'user_variables_by_thread'
Repo is located here:
https://github.com/bryanmobrien/burger
I'm a student, so I understand this is probably trivial, but I've searched stack and heroku support to no avail. I believe somehow the database that works fine locally simply isn't being created -or- I just don't know how to access and modify the database and or tables on the Heroku deployed app.
I have had that problem recently (like 1 hour ago) and this worked for me
1- I did export my database from phpmyadmin in sql format
2- I downloaded HeidiSql, inside JaswDB you have a link to donwload it
3- I installed HeidiSql and Configure my data to connect to JawsDB (when you click in JawsDb inside heroku plataform, it says your host, username and password)
Host xxxxx
Username xxxxx
Password xxxxx
After that i found my database name (this will be your jzg04w8rh30864yk), and I clicked in "execute sql file", I copied my sql exported and I pasted there, after that my tables was created
And that were all, I hope that this can help you

How do I connect my Android Application to a MySQL database stored in a server?

Background on the MySQL database: it was created from a Wordpress website. As far as I know, it can only be accessed through PuTTy with the ff credentials given to me by my client who I’m making the app for:
hostname
port
my username to get into server
my password to
get into server
mysql username
mysql password
It says from multiple sites that this is the PHP syntax to connect Android to MySQL
// Connecting to mysql database
$con = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD) or die(mysql_error());
It does not work and when checked for the connection error, it shows the error “Connection timed out.” when I put credentials needed (hostname, mysql
username and password). I’m assuming it’s because I need to get into the server first (with credentials #3 and #4).
Is there a workaround to this?
EDIT:
This is only based on the assumption that I am supposed to create a PHP file (that I will place inside a Jave file in Android Studio) to connect to their database. Are there other ways to connect to a private server?
Welcome Ateshi!
It sounds like you want an android app to directly access the mysql database that holds the content of a wordpress website.
The MySQL database server is most likely not publicly available on the internet for good reasons (security), as per this answer
You have posted some PHP code. PHP usually runs on the server alongside mysql, it not usually run on android.
Here is how you usually set up something like this:
Your android app makes a web request to http://yourexampleserver.com/example.php
Inside that example.php which is on the server, you have the PHP code that then does:
connects to mysql (with local credentials)
perhaps writes to the database
perhaps queries the database
formats the results into a useful format like JSON
The results are returned to java on your android which then usually shows them in the UI etc
This whole process is usually described as building a "webservice" for the app to use.
If however, you want the database contents to be stored offline and locally on android, then you probably need to connect to the server manually, export the database and download it, and then include it in your android project.

Trying to connect to a mySQL db on Amazon AWS using mySQL Workbench

I just opened an account on Amazon AWS. In this account, I created a mysql database instance, that I am now trying to connect to on my home computer use mySQL Workbench. I have entered the database endpoint (as listed in my account) and added the user name I set up for the master username for the database. When I hit "test connection" (using standard TCP/IP connection) however, I get a "Failed to connect..." message. I have a feeling that the problem may be that I need to use SSL and/or SSH. But I am a neophyte here, and I don't know how to properly set this up or configure mySQL Workbench with this. I am seeking assistance
You need to allow your mysql server to the user my user policy.
You can allow your Public IP address.
Please refer below case:
Cannot ping AWS EC2 instance
I think there that my database instance was misconfigured somehow, though not as JERRY suggests. I created a new MySQL DB instance and was able to connect to that without needing any other special configuration changes. So I am now using the new instance, and have deleted the old one. I wish I could provide more insight into what the problem with the first DB was, but the insight I have is (as I said) after I created the 2nd DB instance, no other configuration was necessary

how to connect Coldfusion to a MySQL database

total newbie and totally lost...
I'm trying to setup coldfusion(8) with a mysql(5.5) database on a local (apache 2.2) webserver running Windows XP.
Coldfusion and Apache are running, but I don't know how to fiddle this in with MySQL.
I'm doing the following:
- Import file1.sql and file2.sql into MySql workbench (5.2) by reverse engineering
- Save this new model as base.mwb into my Apache htdocs folder
- Open the Coldfusion Administrator Data Sources
- Add new Source "myName", Database "base", localhost, 3306, root, password
When I try to add I always get Unknown database 'base' error.
I also tried to make a connection in MySQL or set up a new server instance in MySQL workbench, but these also fail because of no database "base".
I guess I'm missing something (probably a database :-)... Thanks for some pointers or a dummy tutorial. I'm longing for something to show up in http://localhost...
I would have to guess that you are coming from a background using Access DBs. MySQL and ColdFusion do not work together by have a DB file in the CF application. CF connects to a running MySQL server somewhere on your network (even on the same machine) using a JDBC connection. It does not look at a DB file and use that. So you will need to install MySQL Server and then import the DB into that. Then use CF's datasources to connect with that.

Jasperserver installation unable to access database

I am trying to install jasperserver(war) in a CentOS linux machine. It throws up error saying,
Message: [Access denied for user 'jasperdb'#'xx.xx.xx.xx' to database 'mysql']
However, when I access mysql via command prompt it works fine. I am able to access via the user jasperdb from same machine where I am trying to install jasperserver.
It is also weird why jasperserver tries to access the database with name 'mysql'? Any solutions?
The mysql database within mysql is the one where user info is stored. That is why it is trying to access the mysql database. I am assuming you have 'jasperdb'#'localhost' in your mysql.user table. Try making sure that localhost and any other computer names are in your /etc/hosts filled in for 127.0.0.1.
If you are not using the ".war file" installer, I recommend using that. It's a lot easier to troubleshoot than the installer that bundles in Tomcat and PostgreSQL.
If you are using that, then you should find the credentials that you have set in default_master.properties. That includes both the user name and the database name. Run ant clean-config to make sure you aren't picking up any old settings.