Reputation: 5661
I'm setting up a development environment.
I'd like to check whether logging works as expected for MySQL.
How can I do so programmatically from PHP?
Inspired by this answer, I merely ran a minimal test like this:
<?php
$pdo = new \PDO(
'mysql:host=localhost;',
'root',
''
);
$result = $pdo->query( "signal sqlstate '45000' set message_text = 'Triggering error on purpose (test)';" );
?>
However, this does not trigger any error in the error log. I'd expect the error in /var/log/mysql/
(in error.log
.)
I'm running Ubuntu 16.04 inside of Docker on OS X and using MariaDB.
This is a question at the crossroad between programming and sysadmin, so feel free to migrate it to AskUbuntu if you think it's more relevant there.
Upvotes: 0
Views: 45