I had to reinstall PHPMyAdmin and MariaDB.
I have created my database and my user. I can connect to it using SSH
Code: Select all
mysql -u user -p database
Code: Select all
<!DOCTYPE html>
<head>
<title>Connect to MariaDB Server</title>
</head>
<body>
<?php
$host = 'host:3307'; //host name
$name= 'database'; //Name of the data base
$user = 'user'; //user
$pass = 'password';
$conn = mysqli_connect($host, $user, $pass);
if(! $conn ) {
die('Could not connect: ' . mysqli_error());
}
echo 'Connected successfully';
mysqli_close($conn);
?>
</body>
</html>
My sockets are /run/mysqld/mysqld.sock in MariaDB and /run/mysqld/mysqld.sock in PHPMyAdmin.
excepted that, I really doesn't know what should be the trouble.