mysqli::query(): (HY000/1194) I have a server on Azure with a MySQL database, we have two apps there and sometimes we get this error on the code:


Warning: mysqli::query(): (HY000/1194): 
Table 'noticia' is marked as crashed and should be repaired 
in D:\home\site\wwwroot\classes\ConnectionFactory.php on line 122



Some questions:


What kind of things could cause this error?
Where can I find the logs in order to get the cause of the error?
Could this be could a PHP problem?


This is too strange because I have been using the same ConnectionFactory class to connect to the database for several year and this is the first time that we get this error.
I assume this is a MyISAM table. These are not crash safe. InnoDB tables on the other hand, are.


There could be several reasons, such as:


disk failure
VM reboot or crash
mysql daemon crash - open MyISAM tables are likely to crash if the mysql daemon crashes  


See also: Why do MySQL tables crash? How do I prevent it?
The MySQL error log is by default located in the datadir. By default, the file name is the name of the host with the suffix '.err'. 
I don't think so, not unless PHP managed to crash the mysql daemon.   


You may be able to repair the table by issuing a mysql command like:

REPAIR TABLE your_database_name.noticia;


Or, from the command shell, you can run something like this to check and repair all tables:

mysqlcheck -u root -p --auto-repair --check --all-databases