I am trying to connect to MySQL with PHP but i keep getting the following error: "mysqli::__construct(): (HY000/2002): No such file or directory in /Users/markjonathas/Documents/bar/database_connection.php on line 9" I have MAMP downloaded and I am using PHP 7.3.1 and MySQL version 8.0.16.
I have tried to to download Sequel Pro but when I try to connect to the database I get the following error: "MySQL said: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/lib/plugin/caching_sha2_password.so, 2): image not found"
//code for database_connection.php:
<?php
    $servername = "127.0.0.1:3306";
    $username = "root";
    $password = "-------";
    $database = "barDB";
    function db_connect() {
        $connection = new mysqli($servername, $username, $password, 
$database);
        return $connection;
    }
    function db_disconenct() {
        if(isset($connection)) {
            $connection->close();
        }
    }
?>
//code for connecting to database_connection.php:
<?php
        require_once("database_connection.php");
        $db = db_connect();
?>
 
     
    