Answers for "mysql.connect"

PHP
18

php sql connection

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn= mysqli_connect($servername,$username,$password,$dbname);
// Check connection
if (!$conn) {
  die("Connection failed: " . mysqli_connect_error());
}
echo "Connected Successfully.";
?>
Posted by: Guest on May-11-2020
3

mysql cli connect with password

mysql --user=root --password=mypass
Posted by: Guest on July-01-2020
-1

mysql connect

$mysqli -> new mysqli(host, username, password, dbname, port, socket)
Posted by: Guest on April-26-2021

Browse Popular Code Answers by Language