AWS Aurora MySql Server - php

Created an AWS RDS Aurora server. Copied database from another active AWS RDS Instance. Created Aurora server can be accessed by a MySql client app. And can also delete table records, which will be the normal tasks eventually. The problem is I cannot access a website pointed to the Aurora server. Error message: Unable to connect to database server. The MySQL error was: Bad handshake. Settings.php already contains the correct username and password information.
Advance thank you for any assistance.

This is likely because of the version mismatch of MySQL server that leads to the failed authentication. You are either:
Using an old version of MySQL on your client to connect to the server with a newer MySQL version.
Using a new version of MySQL on your client to connect to the server with an old MySQL version.
The newer MySQL versions might use a different protocol for the connection, thus causes the bad handshake issue when there’s a version mismatch. For example, using MySQL 8.0 on your local environment might not be able to connect to the server using MySQL 5.7.
To solve this problem, you should:
Check the versions of both your local and remote library/server, then install the same version on both environments.
Use a library that supports multiple versions of MySQL to avoid the risk of updating the server and potentially damaging data.

Ensure you are connecting with a public IP to the RDS service
The RDS service port is exposed via the AWS service. Any firewall restrictions exist.
Use telnet from your web server and ensure its able to reach your RDS server and connect to the particular port.

Related

How to connect to mysql database in digitalocean from windows

I am newbie to cloud hosting. My Client has created his domain in digitalocean. He then provided me with the username and password to access the site. Through filezilla I am able to ftp the site with the credentials he had provided. He had also stated MariaDB has been installed for mysql; but I am unable to login to my mysql server. I tried to initiate a mysql connection using the MySQL Workbench but it failed. Would appreciate any help on how I can access the mysql server using my Windows Machine.
This article might be of interest to you: http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

Laravel 4 Connect to EC2 MySQL from remote domain

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!

Connect to MySQL Database on cPanel Server Externally from Heroku?

I am using the Heroku app to host a facebook application since Facebook is changing how they have their applications set up, again. However I need to connect to the MySQL Externally from my cPanel VPS and I am not able to connect correctly. I have tried using the darkprospect.net(host domain), ultimate-battle-online.com (primary domain of user) and 184.154.20.170 as well as those plus the combination of added port 3306 and none have worked. I previously needed to make sure that I added the right domain to the right file but right now it's just not connecting. Right now get this error when using mysql_connect() function:
Lost connection to MySQL server at 'reading initial communication packet', system error: 110
Again, thank you for any ideas that you may have!
EDIT: I found out that it was an issue with the buildpack that is the default for PHP apps, since I develop on a VPS with PHP 5.4.7 I was using parameters that were tuned for it and were not very supportive on their bundle of vanilla PHP and Apache.
I was able to create a new Heroku buildpack that was able to support all of the features that my application was needing. Because I was developing on my VPS in PHP 5.4.7 my configurations were designed for more of the new features and with the Heroku's basic Buildpack only having PHP 5.3.10 there were unseen errors in background logs that were halting the connection process. Additionally CSF Firewall was configured only for UDP income 3306 and I was able to add it to UTP as well and that seemed to resolve the Connection Timed Out error that was the final error after I made a better buildpack for myself.

Can I connect to a remote mysql instance without installing mysql locally?

I'm trying to connect to a remote server's mysql instance from PHP on my main server.
The main server itself has no mysql installed but the server I'm trying to connect to has mysql installed.
PHP is installed on both servers but I was wondering if it would connect when mysql isn't installed locally.
You only need a client mysql library specific to your database connection stack, not a mysql server installation.
There's no reason that I can see for it not working. Keep in mind that you'll need the hostname of the server and the server will have to have remote_access configured.
All you need is to have the second server's URL and SQL info such as username and password.
no reason for it not to work.

How can I connect to MySQL database on a dedicated Windows 2003 server from EC2 based app server with PHP

I have developed a web application that uses PHP and MySQL and has all been running fine from a single development server. I now want to separate things a bit and place an app server within Amazons cloud that will receive and process uploaded files. The database is going to remain on the dedicated server but will need to be accessed by the EC2 instance.
Heres what I have tried so far...
In phpMyAdmin I added a new user to the privileges table. I gave it the elastic IP address from AWS as the host name, a new password and granted privileges to INSERT, SELECT and UPDATE.
In the PHP scripts on my EC2 based app server I included this username, password and the domain name of the location of the mysql server (example.domain.net) when connecting with mysql_connect
I have a simple test page that tries to SELECT and echo some results from the database but get the following error -
Could not connect to MySQL: Can't connect to MySQL server on 'example.domain.net' (4)
What could this mean, what have I missed, are there any other issues such as trying to do this from within EC2 that will cause other problems?
cheers all
Turns out the only other thing I needed to do was to open port 3306 on the database server to allow access. Did this by going to Control Panel -> Windows Firewall -> Exceptions -> Add Port ["SQL", 3306]
Now it works great!

Categories