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!
Related
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.
so I'm creating a website right now where I have a mySQL Database included and I'm displaying some tables of it on my website (with PHP) and it works fine.
But now I'm trying to access the database in another program (Unity) to edit my database.I get the error that the host name wasn't found. Then I tried to ping the ip (given from my hoster 1&1) via the Windows console, but not found. mySQL Workbench doesn't find it either.
I'm wondering if I have to set the database to public or something like that when I want to access it from another program. My Website can access it, probably because it's hosted on the same account.
But I only got a hostname, username, password and database name. The hostname is something like that: "db123456789.db.1and1.com". My domain is of course not this. Do I have to change the host name? On my php website script I used this host name and it works fine.
I'm kind of confused how this works and I can't find any option where I could say like "Hey DB, show yourself to the public".
Any tips? Searched the World Wide Web, but didn't found a hint. Thank you.
I'm new to website hosting.
I had successfully uploaded the files, now I want to upload database, can anybody help me to upload database from my localhost to my hosting website.
Use following step:
Go to cpanel.
create database by going to database option in cpanel.
assign db user to that database.
now go to that phpmyadmin.
export local db.
now import on live db.
Set home url and site url in option table.
work is done.
Generally all hosting services offer PhpMyAdmin. You can save your localhost database as local .sql file and import it on the server database.
PhpMyAdmin takes care of adding the commands to create the tables, so it is pretty easy.
You can find more details in the PhpMyAdmin docs.
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...
I'm doing this website and I first tested it locally. Everything works including the database. The form from the html automatically sends submitted data to my database. The problem is, I want to host it online. I already have the website. I use webfreehosting.net. How can I insert my database to the file manager? I checked out the mysql manager and it says it imports text files. But the database folder on my local disk has opt and frm files only.
It looks like you are just starting out with web development. There are better, safer and faster ways to take MySQL dumps, but I would suggest you start with a graphical interface that aids in learning.
Your hosting provider would have provided you with a control panel. On their website, I can see that they provide phpMyAdmin. To import your database, you need to take the following steps:
Download a desktop MySQL administrator like MySQL Workbench
Export your database to a .SQL file
Log in to your web hosting control panel.
Create a Database.
Create a Database user and set a password for this
Grant this user all permissions to your database (not advisable, but its okay to start with)
Find phpMyAdmin. You will see this database listed.
Click on import and Import the database .sql file you created in step 2
Take a backup of your development database using mysqldump, then run the generated SQL against your production system.
Export your local database from MySQL Workbench in SQL format (text files). Then, import the same into online database using PHPMyAdmin.
How can I insert my database to the file manager?
You do not. If you made the website, you should know that you did not use it. Use phpMyAdmin for SQL.
Also, if you application is not working then check if you have made configuration changes in the file, like username, password.