I am running this code:
include '../includes/connection.php';
$conn = dbConnect('backup');
$tableName = 'orders';
$backupFile = '../backup/db-backup(' . $date . ').sql';
$query = "SELECT * INTO OUTFILE '$backupFile' FROM $tableName";
$result = $conn->query($query) or die(mysqli_error($conn));
I am getting this error:
Access denied for user 'ideapale_amadmin'@'localhost' (using password: YES)
I know the password and username is correct, and I have tested connecting to the database without running the query and that works fine. Also, the user I am currently using has all privileges. Therefore, I think there is something wrong with my sql statement.
Why am I getting the 'access denied for user' error?