How to get PHPMyAdmin to display MySQL warnings?

I am using PHPMyAdmi n for the convenience of updating a remote database.

But it does not show default warnings that have recently led me to some unpleasant problems when I updated the SET field with a line not on its list and did not notice the problem.

I am using 2.11.9.1 (Dreamhost default install) .

In the PHPMyAdmin wiki, it displays “Display Alerts” as a function version 2.9.0 and even “Show all warnings” as a feature of 2.10.2 - but how do I do this? The documentation is small.

+4
source share
4 answers

I do not believe that Dreamhost gives you access to the configuration file for installing phpMyAdmin. However, you can easily create your own phpMyAdmin installation by downloading the source code from their website and simply spinning it into the directory you want to access. at (your-domain.com / phpma for example). Then follow the instructions to edit your configuration file (which should include the inclusion of alerts, as you requested).

+1
source

I was just looking for the same thing.

When I run INSERTs using the standard phpMyAdmin "insert" form, the rows will be inserted, but a red bar will appear indicating any warnings. But when I did the volume insert, no warnings appeared, and instead a green bar appeared, and simply talked about the number of lines affected (giving the impression that everything went well, but in fact it may not be).

I found that I had to send the SHOW WARNINGS manually. For example, when I run this query, I put both statements in the phpMyAdmin SQL field.

 INSERT INTO test2 SELECT * FROM test1; SHOW WARNINGS; 

This gave a list of warnings like the following ...

 Level Code Message Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'a' at row 3 Warning 1265 Data truncated for column 'b' at row 3 Warning 1366 Incorrect integer value: 'x' for column 'b' at row... 


Notes:

  • You cannot run the SHOW WARNINGS later; it will be empty. It should be in the box with your initial request when you click "Go." This is because MySQL only contains warnings for the last query you requested. Each time you click a link or button phpMyAdmin launches all kinds of other queries in the database, and therefore your previous warnings are lost.
  • phpMyAdmin does NOT support displaying multiple results from a user request. So this is how one SQL script does NOT work ... (since version 3.4.10.1)

     INSERT INTO test2 VALUES ('my text', 'something else'); SHOW WARNINGS; # you won't see the warnings from here INSERT INTO test2 VALUES ('my text', 'something else'); SHOW WARNINGS; 

    Although the method above does not work in phpMyAdmin, it MUST work fine in the MySQL command line client. So use this if you need to.

If you have multiple inserts and want to show all warnings, you need to bind them together as one INSERT . For instance:

 INSERT INTO test2 VALUES ('my text', 'something else'), ('my text', 'something else'); SHOW WARNINGS; 
+1
source

I could be wrong, but if I remember correctly, you need to have access to the phpMyAdmin configuration file to enable it.

0
source

follow the instructions on the site to edit the configuration file (which should include such warnings as you asked).

Well, yes, it should. But I do not see it in the configuration file, and I do not see it on the page that you linked to. I already looked for information in obvious places, believe me.

0
source

Source: https://habr.com/ru/post/1276967/


All Articles