I have just installed MySQL on to my AWS EC2 server, I have also imported my existing SQL file so that my new MySQL db is now populated. I would like to be able to browse my database somehow.
In the past I used phpmyadmin and it was great, should I install phpmyadmin and then access it through my browser somehow? or am I looking down the wrong road.
Cheers
No reason you cant install phpmyadmin on your new EC2 server. Just remember to open up the necessary ports through amazons security group, and if you dont want the whole world to be able to access it, you can restrict the ports to only IP addresses you use.
AWS SECURITY GROUPS
Related
I need some major help in setting up my android app to add/receive data to/from my database. I'm using Amazon's RDS service in connection with xampp's phpMyAdmin. I've already successfully connected my DB instance to the database in phpMyAdmin. Also, I've written my php scripts to do basic CRUD (Create, Read, Update, Delete) commands in SQL. I've been following this tutorial.
The problem for me is, in his tutorial he is using strings like this:
private static String url_all_products = "http://api.androidhive.info/android_connect/get_all_products.php";
to run his php scripts in a call to makeHttpRequest(url_all_products). But I don't have my own website to do this and I'm pretty sure I don't need one to do this.
Next, I have a test.php file that does a simple echo statement and it works when I run this in a web browser:
http://localhost/phpfiles/test.php
Which leads me to my second problem. I don't want to use localhost because I need these php files and the ability to retrieve data from the database to be accessible to anyone using my app. This is the sole reason I'm using Amazon's RDS service so my database can be accessed on the cloud.
So how can I use the host address provided to me by Amazon RDS to access the database and where do I store all the php files so I can properly use them in Android the way the tutorial shows? They are currently saved in xampp/htdocs/phpfiles/.
I feel like I'm missing some fundamental understanding of all this and I'm going about it all wrong. If someone can point me in the right direction that would make my day.
It sounds like you don't really need the XAMPP install on your local machine at all. You're hosting this on Amazon and you want it to be available to the internet, so your local computer isn't involved. You can use XAMPP locally for testing and development, but for production use you'll be exclusively on the Amazon RDS cloud.
But I don't have my own website to do this and I'm pretty sure I don't need one to do this.
You may not want a website, but you do want your services hosted on the internet. That's what your RDS instance is for, and technically the tutorial is referring to an API which happens to be exposed through a web page. This is a much better idea than opening MySQL directly to the internet on port 3306.
You'll then use your Amazon host — for which you really should use a FQDN such as api.example.com rather than the IP address, but the IP address will work just fine from a technical aspect.
The files you refer to are on your local XAMPP installation; in the xampp/htdocs/phpfiles/ folder, and need to instead be on the RDS instance.
Then your application accesses the API you expose in those files which return information back to your application.
I have developed a table based view.php, which consists of a local mysql database part, that does a remote left join on external oracle databases (read-only) from our partner company.
All working fine on my local machine so far. Now to my problem:
I need to somehow distribute the view.php to every windows 7 computer in our office network.
We have absolutely no chance to install or execute any files (or
local webservers) on our computer/network. Anything, that requires
administrator rights will not work.
Simply getting the administrator password or asking about any
changes to an administrator is out of question.
The oracle databases (read-only!) are secured with a firewall, which
only permits connection requests from our static ip on our working
machines.
Considering the mentioned limitations above: how can i make the php file accessible to the other machines in our office with a working external oracle database connection from the office ip without the possibility to install a webserver or in general without execute rights? is there anything else i can try?
Is there a way to publish the view.php on a remote webserver and somehow connect to the oracle databases from our local ip instead of failing by connecting from the webservers ip?
Any help is highly appreciated.
Thanks in advance.
Not sure if what I am attempting to do is possible or not. I just launched my very first EC2 instance running Ubuntu 12.04 and successfully installed Laravel 4. I have the database working just fine on the EC2 instance and I am able to connect to it with MySQL Workbench on my local machine using a .pem SSH key.
I will be using EC2 to handle certain aspects of a product that I am developing to ensure improved reliability - client side users will be interacting with this primarily through CURL. I want to be able to have my non-EC2 website, also running Laravel 4, use the MySQL database that I set up on my EC2 instance.
I tried changing my app/config/database.php file to include the EC2 instance IP address and MySQL credentials, when Laravel attempts to connect it returns a timeout error.
I modified my.cfn and commented out bind-address = 127.0.0.1, I do not seem to have the skip-network that I have seen mentioned. Still no joy.
Any suggestions?
In side MySQL (PhpMyAdmin if you installed it) -> Users overview -> Edit your user with Host is
%
That is mean, you can connect to MySQL in anywhere with command
mysql_connect($IpOfYourHost, $UserAbove, $Password)
Maybe this helps you. :)
Resolved
I changed bind-address to 0.0.0.0, created a new MySQL user - 'user'#'%', and had my host whitelist the IP. Done!
I know this is not a particular php question, but it is to do with accesing php by using mysql when the file is not hosted on the same domain.
For example, im using hyperedit, the php coding tool that allows you to display the results of php in realtime as you code.
However when i try and type my mysql code in, that i know works(i tested it using my servers built in php/html etc creator) i get a error:
Connection refused (trying to connect via tcp://myservername.servername.com
Its definitely not my code, i think instead it is something to do with the fact that the file is not being hosted on the server? I have only tried it in hyperedit but i think the same would occur in other programs too.
I know its not specifically php or coding related, but i thought this is the best place to ask!
If anyone could help me it would be great!
Thanks very much!
This is because your local development machine does not have access to the mysql server in question.
If this is a shared account, you may be able to grant access to your remote machine's IP/hostname through cPanel. If you have direct access to the remote box through the cli, you can do it via a sql GRANT command, like so:
GRANT SELECT ON mydb.* TO myusername#'my_IP' IDENTIFIED BY 'mypassword';
Otherwise, it may be locked down in a shared environment where only machines on the local subnet can access the mysql server (cough, GoDady, cough).
So there's no real answer. Either you have the privileges to give your remote machine access, or you don't. If you don't, consider using another host that does allow you to do what you need.
Good day!
I've searched for many sites on how I could deploy my PHP projet in the internet but I don't know how to do it because I am confused with some of the technical terms.
You see, I am using xampp for my local web server. Now I want to put it in the internet. I found some free web hosting sites so i've decided to upload all my htdocs files inside it.. But how can I put the xampp (apache server) and my mysql database on it? I'm confused. Please help. A step-by-step procedure of what should i do could be really helpful. Thank you in advance.
Get a hosting account (try www.bluehost.com for instance).They will set you up with a Linux server and MySQL. You don't have to install Apache or MySQL, you will use whatever they've got. All you need to do is upload your PHP files to the right folder, setup your database on their server and you should be good to go.
If you buy a domain-name and space, connect them using the NS settings
If you are using a free, then the settings are already okay.
Export the database from your XAMP.
Login to the remote server. There you'll find PHPMyAdmin. Import the database.
Upload the file.
Make sure file listing is off. That is if a user goes to any directory he can not see the file list!
Done :)
Simplifying a bit, there are two ways you can get your site online.
First, you could purchase or rent a server that is yours and yours alone. This is commonly called "dedicated hosting" and costs somewhere around $100 / month. If you choose this option, you have your own server housed in a datacenter somewhere, and you must install Apache, MySQL, and any other server software you care to use.
I doubt, given what you've described, you have chosen this option.
Second, you could rent "shared hosting" from any one of the dozens of hosting providers out there. If you do this, with a typical cost of $2 to $10 per month, the hosting provider is administering the server. You have no direct access at all. Your only access is through the tools they provide.
Given that, how specifically you can upload files is up to them (is it FTP? SSH? a horrifying web-based upload tool of some kind?) Similarly, how you access your MySQL databases (assuming they offer MySQL databases) is entirely up to them as well.
Many providers now use a tool called cPanel for this administration, so you may try browsing to www.example.com/cPanel (using your domain) on the off chance that works. If not, though, follow the instructions your host provides. Only they can correctly describe how their setup works.
The hosting will be already having apache and mysql installed you only have to put your files thats it
I suggest you contact your webhosting site. The web hosting needs to host php, and mysql. Then you can upload your files to their web server, and copy your mysql database to their mysql server.
You do not need to transfer xampp to your host: apache and mysql are running on nearly every server
Upload all your files in your htdocs directory via ftp to your server
To transfer your database, use phpMyAdmin. It is installed with xampp and alos installed on nearly every server. In phpMyAdmin, use the export/import functionality
In your php file where you connect to the db change the login settings to the settings the hoster gave you
That should work...
Hosting Company already have setup for apache,php, mysql. All you need to uploads all your
files from xampp htdocs to a right folder like public_html using a ftp software like
filezilla. They also provide a control panel like using which you can manage your mysql
database and all others settings like directory permission.