I have a site remotely hosted away from the Google Cloud SQL instance. I have set up and authorised CIDR range for this. I am using PHP (PDO) to connect to the Google Cloud SQL instance with an application built on the Laravel 5 framework. The website itself is deployed on Windows Azure, I do not have a choice about this stack.
My problem is on probably about 10% of page loads I receive the error:
SQLSTATE[HY000] [2006] MySQL server has gone away
While trying to set up the CIDR for this in the developer console (getting my Azure IP and converting it to a range) I had this problem 100% of the time, so it's possible that it's related to IP authorisation, however why would this work 80-90% of the time, and deny the application sporadically?
Any help would be much appreciated.
go to the cloud sql instance you created. Under properties you will see "authorized applications" click manage and add the project id of your project to it. hope that works for you
I know this is old, but in case someone else ran into similar problems like I did, this might help...
Check your system clock, make sure it's not behind (happened to me with a local docker instance)
Check your credentials to make sure they're correct and match up with the instance you're trying to connect to.
Good luck
Related
I have a WordPress site running on Digital Ocean droplet with MySQL database on the same server. I am trying to migrate the database to a remote database. I used Digital Ocean's managed SQL service in the same region for it, but after changing the database configuration in wp-config.php, the site is taking 30+ seconds to load now.
I also tried using the GCP's Cloud SQL but facing the same issue.
I would suggest first confirming if you can reach the remote SQL server on your own and what's the response time from the other server.
If everything seems fine and both servers are in the same region, ask DigitalOcean if it's possible for the two servers to communicate in the private network instead of connecting through public IPs.
Finally, if you are still experiencing this issue, I would suggest reaching their support and explaining this issue. They should be able to help if it's a "managed" service.
I have this setup currently.
My front end runs on Google App Engine ( GAE ) on PHP. I use PDO to connect to an open AWS RDS MYSLQ 8.
I can not move the data out of the AWS RDS instance.
I have been requested to make the RDS secure and not allow open in coming ports like 0.0.0.0/0 in the AWS security group.
I want to know if there is a serverless way to achieve this type of connection without setting up a EC proxy or an Google Compute Engine server.
I am not able to find a solution and all known solution points to setting up a proxy.
Any one have any thoughts on this problem?
It's hard to tell something without any codes and errors stacks etc. But I have some thoughts.
If you are thinking of "serverless" solution. "serverless" does not mean that there is no server, but it means that there is no need to care about sever which is being maintained by some service provider (like GAE or other). So practically there is no 100% serverless solution, but it's just covered behind provider logic.
The main question is that you cannot connect to RDS. This should be possible form local machine. So you should be able to develop something that is working on your local machine and than for sure you are able to deploy the same logic to App Engine.
If above is not possible, you should consider GCP cloud SQL or serverless.
I’m part of a very small company that uses a database hosted on a server (104.131.##.###). However, the server no longer responds and the person who set up and owns the server space has already left the company. This past employee seems disgruntled so they won’t help. It’s complicated, but we decided to open a new server. The only issue is, I don’t know what we were using.
What I do know is I would access and change the database at http://104.131.##.###/phpmyadmin/ (image of login below)
I also had php files stored on the server using Filezilla (in a “var” folder, if that helps) which were accessed via path: http://104.131.96.###/path/to/file.php
I’ve set up a version of the same server using xampp on my own computer, but I can’t keep my computer running constantly.
So my question is, what service were we using / should we use? Where would I start to set up a new server like this? (I still have the php files and can recreate the db)
I've looked into AWS and digitalOcean, but I'm in a bit over my head and can't tell if they're offering what we need.
Any help would be appreciated. Thank you
The server was using phpmyadmin and mysql and Digital Ocean.
So you need at least a LAMP stack. With the info given we can't help you more.
I have an application that has been developed with Codeigniter. It uses an SQL Server database, hosted in an Amazon RDS Instance.
The application is using the mssql driver (I can't change it to sqlsrv, unfortunately).
The RDS instance is ok, I tried connecting to the database from an SQL Server client, and everything works perfect, but when I try to connect it in the CI application, I get the classic "Unable to connect to your database server using the provided settings." error.
Is there a way to have a more descriptive error thrown by CI? I have lost a lot of time trying to solve this issue and I really don't know what else I should look.
Notes:
This was working fine some days ago. I had to make a copy of the CI app (which is hosted on an Amazon EC2 instance). I shared the AMI to a different AWS account, and created a new instance with it, but didn't change anything in the volume. Everything has been exactly copied from one place to the other.
Php info tells me that the mssql driver is there and it is correct.
The Security Groups in the RDS instance and the EC2 instance, are open to the world (I deleted all the restrictions in order to see if that was the problem)
I will really appreciate any kind of help.
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.