Connect with MySQL database externally from wordpress site

  • Status: Closed
  • Prize: $20
  • Entries Received: 3
  • Winner: Mahediii

Contest Brief

EC2 Instance A (Amazon Linux) has MySQL database on MariaDB server.
EC2 Instance B (WordPress) has website pages. Add Code Snippets in WordPress website page to connect with MySQL database running on Linux instance A. Describe a brief process using general terms. Below is the example of snippet code, the info are not correct, its just for ilustration. Add points if any setting or security need to be updated on Linux instance.

<?php
$servername = "ec2-4-147-150-57.us-east-2.compute.amazonaws.com";
$username = "username";
$password = 'password@123';
$dbname = "database";
$dbport = '3306';

$connect = mysqli_connect($servername, $username, $password, $dbname, $dbport) or die(mysqli_error($connect));

if ($connect)
echo "successfully connected!";
?>

Recommended Skills

Top entries from this contest

View More Entries

Public Clarification Board

  • ahmedabdo1201125
    ahmedabdo1201125
    • 2 years ago

    Copy the code from the editor and paste it to find out the problem

    • 2 years ago
  • ahmedabdo1201125
    ahmedabdo1201125
    • 2 years ago

    I can't understand your problem

    • 2 years ago

How to get started with contests

  • Post your contest

    Post Your Contest Quick and easy

  • Get tons of entries

    Get Tons of Entries From around the world

  • Award the best entry

    Award the best entry Download the files - Easy!

Post a Contest Now or Join us Today!