How to debug MediaWiki's Database error? - mediawiki

How to debug MediaWiki's Database error?
A database query error has occurred. This may indicate a bug in the software.
It would be good to have some more information about what's going on exactly.
https://www.mediawiki.org/wiki/Manual:How_to_debug is not directly helpful

Actually the MediaWiki Manual is useful.
This helped:
$wgDBerrorLog = '/var/log/mediawiki/dberror.log';
Just don't forget to create the directory and give permissions to www-data (or whichever user runs your PHP).

Related

How can I enable the binary log tabin phpmyadmin 5.0.1?

Well, I'm trying to locate the log file to check errors in phpmyadmin interface and I saw in posts and forums that phpmyadmin have a binary log tab to check it, but I don't have enabled that tab and the solutions I found don't have any real solution to me...
Thanks yall!
The Phpmyadmin application does not have a log file, however you can perform this trick:
Phpmyadmin has a php script that when executed will return a result with the errors you find.
On Ubuntu Server the file is in:
/usr/share/phpmyadmin/error_report.php
then you must enter that folder and run
php error_report.php
this will return the errors that Phpmyadmin has, most of the time they are errors in the configuration file config.inc.php
What problem are you seeing with phpMyAdmin that you hope to fix by viewing the log? You haven't really described what problem you're trying to solve, which makes answering your question a bit difficult.
There are a number of logs available, but the most direct answer about the log file to check regarding errors with phpMyAdmin is in your webserver's error log. Read on for more details, though.
If it's a problem within phpMyAdmin directly (or something that phpMyAdmin does with MySQL), it's usually shown directly on the screen as a friendly message. If it's something that breaks phpMyAdmin directly, it's logged through whatever means you have configured for PHP errors to be logged (usually directly to the webserver error log).
If you're having a problem with a query through MySQL, those are logged by MySQL through the MySQL error log, which is usually to a file in most systems I'm familiar with.
The binary log is not related to error logging, but is instead an ongoing transaction log where MySQL records ongoing queries (docs, more docs). Based on your description, this is not what you're looking for.

MySQL is hiding my Routines (stored procedures)

After creating a couple of Routines in MySQL, I came back to my database and they were missing, but still showing the name.
It says that I might be lacking the privileges necessary to edit them, but that is not the case. I am logged in with the same account that created them, which is an admin account.
To see if they were in the information_schema, I ran this:
SELECT routine_definition
FROM information_schema.routines
WHERE routine_schema = 'databasename';
...but it shows two null entries.
Are my Routines completely gone? Did I do something wrong when creating them?
I've used MySQL for years and haven't had this happen before.
EDIT:
I just called the Routines and they do work... meaning they return the data. My only issue is that I cannot view or edit the code.
In Motion Hosting responded with an explanation.
Unfortunately due to the recent changes by cPanel, use of MySQL routine is not something that is officially supported on a shared hosting plan. While it may be possible to manually create it through a custom phpMyAdmin install via your cPanel credential, the interface provided by cPanel will no longer work to modify routines. If you need support for routines, you will need to upgrade to a VPS or higher plan.
From what I understand, MySQL sets the security of the routine to "DEFINER" which identifies you by your login. Once you log out and back in, that ID has changed, thereby hiding your routine code.
Similarly, the routines do not show up in a MySQL backup, either.
Depending on which hosting service you are using. Although I have researched several times on Google, I have not found any solution that works for me.
As soon as I log in with cpanel -> phpmyadmin I am unable to run routines.
I am unable to edit and export routines
Solution :
Log in as the root user of whm
From the left menu bar, search for phpmyadmin Access to PHPMyAdmin's root account
Routines will be accessible to you routine access

Magento Module install SQL not running

I have written a module that is refusing point blank to create the tables within my mysql4-install-1.0.0.php file....but only on the live server.
The funny thing is that on my local machine (which is a mirror of the live server (i.e. identical file structure etc)) the install runs correctly and the table is created.
So based on the fact that the files are the same can I assume that it is a server configuration and or permissions problem? I have looked everywhere and I can find no problems in any of the log files (PHP, MySQL, Apache, Magento).
I can create tables ok in test scripts (using core_read/write).
Anyone see this before?
Thanks
** EDIT ** One main difference between the 2 environments is that on the live server the MySQL is remote (not localhost). The dev server is localhost. Could that cause issues?
Is the module which your install script is a part of installed on the live server? (XML file in app/etc/modules/, Module List Module for debugging.)
Is there already a record in the core_resource table for your module? If so, remove it to set your script to re-run.
If you file named correctly? The _modifyResourceDb method in app/code/core/Mage/Core/Model/Resource/Setup.php is where this file is include/run from. Read more here
Probably a permissions issue - a MySQL account used by public-facing code should have as few permissions as possible that still let it get the job done, which generally does NOT allow for creating/altering/dropping tables.
Take whatever username you're connecting to mysql with, and do:
SELECT User, Host
FROM mysql.user
WHERE User='your username here';
This will show you the user#host combos available for that particular username, then you can get actual permissions with
show grants for username#host;
Do this for the two accounts on the live and devlopment server, which will show you what permissions are missing from the live system.
In the Admin->System->Advanced section is your module present and enabled?
Did you actually unpack your module to the right space, e.g. app/code/local/yourcompany/yourmodule ?
Do you have app/etc/modules/yourmodule.xml - I believe that this could be the overlooked file giving rise to your problem.
the cache could be the culprit, if you manually deleted the core_resource row for your module in order to make the setup sql run again, you have to also flush the cache
probably a difference between dev and production servers is cache settings, that would explain why you only see this in production
For me, the issue appeared using Windows for development. Linux system is case sensitive. In my config.xml the setup section was named camelCase while the folder was named all-lowercase. Making them the same made the script run.

how to find the connection string details for mysql in IIS?

I installed php and mysql on my IIS 7,
Now, I can see the phpinfo() and it all works great, except, I dont know where and what are the connection string details are for mysql.
I am trying to install wordpress (via web platform installer on IIS) and everytime I try to install it, it asks for database details - I understand why its doing that, except, I dont know what they are myself.
After a lot of googling and searching, I am surprised that there are literally NO information on how to do this, no tutorials anywhere, not even bugs on this. Either that, or I'm barking up a different solar system.
Any links to tutorials on how to do this would be very helpful. But most importantly, how do I find the details about mysql?
thanks.
Do yourself a favor and download a proper GUI for working with MySQL, such as SQLYog or something similar and forget that poo of PHPMyAdmin. As mentioned, your username is most likely root without password.
You can search for a program called mysqlinstanceconfig.exe (or something similar, you should have it in your MySQL installation folder) - it allows you to quickly reconfigure your instance and you can reset your login credidentials with it.
About MySQL GUI-s: if I'm not mistaken, there's one free coming directly from MySQL but I'm not sure about that. Forget about PHPMyAdmin, it's the worst piece of code ever written and a HUGE security hole.
As you're running a MySQL server locally, your hostname would be localhost, and you can use root as the username, and put nothing as the password.

Webapp works on my windows dev box but not on server which is running Debian

I have a web application based on a mysql database.
It works fine locally but not on the unix machine.
I have tried looking at the Tomcat logs but they don't seem to have any errors.
How would you go about trying to debug this. I know it' possible that there are no answers. I am just hoping that someone had a similar problem, can post a fix that just might work for me.
I am asking for issues to consider rather than solutions. So the obvious ones are:
Have you pointed to the correct server
Did you use the correct username and password
Check the port
Check that mysql has been started
Or if you could tell me where I might see some error messages - does mysql have logs that would point out errors.
MySQL does have logs which can help find the solution, but I suspect the issue is in the code. Have you added logging and/or error catching in your code?
One thing to consider is that MySQL table name references are case sensitive on non-Windows platforms.