How can I enable the binary log tabin phpmyadmin 5.0.1? - mysql

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.

Related

How to continue a .sql database import in MySQL after the server has gone away

This is how the error happened - I was using MySQL shell to import a 16G .sql file that contains multiple tables using the source command and optimizations (as the first solution in this question, with maximum values indicated in MySQL documentation). The import seem to have gone on for a while, and then I got ERROR 2006: Server has gone away when I checked it after three days. It seems to have happened in the middle of inserting rows into a table that already has hundreds and thousands of rows inserted.
I restarted the server, want to pick up where the import has left off so I don't have to duplicate all the work and possibly run into the same problem, and got stuck trying the following options -
Finding where the problem is through logs. Since I haven't initiated error logs (reference here), I looked for binary logs. The SHOW BINARY LOGS command shows a list logs as the documentation says it would, but I couldn't view the logs themselves, so I can't figure out where it's gone wrong.
Insert-ignore - I have tried the first and second solutions to this question import mysql data interrupted, how to resume? but kept getting syntax error when I tried to reference the full path to the .sql file, which is on an external drive.
Look for an insert-ignore option that works with the source command, with which I've imported several smaller large .sql files, but so far haven't found it.
Run snippets of the .sql file using MySQL WorkBench - it was unresponsive for a few hours and eventually loaded a blank window. I also tried opening the .sql file using NotePad, ATOM and Sublime, they all haven't loaded.
My last resort would be to break up the .sql file into snippets, and then copy and paste potentially hundreds of statements into MySQL shell, but I'm hoping that I don't have to go there.
Any suggestions?I'm using MySQL community version 8.0...and also I am a SQL newbie so might be missing something really obvious. Thanks in advance!
EDIT -
On 2)- Figured out how the syntax works with full path in INSERT-IGNORE after rereading documentation of the query. But then the LOAD DATA command has directory and also unique key constraints which I might not be able to satisfy.

MySQL Running SQL Script error - [WinError 32] The process cannot access the file because it is being used by another process:

I am getting an error while running a SQL script to load data. Error is pasted below:
Preparing...
[WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\PRATIK~1\\AppData\\Local\\Temp\\tmpf75l0wi5.cnf'
I have tried uninstalling and installing MySQL several times but nothing is helping.
I faced the same issues while trying to run a MySQL script. I tried to find the process in the temp folder and removed it and tried again but the process seems to start again and appears in the temp folder. I could not run the script, however, I found a workaround, instead of running the script try to open it and run it in the query editor.
Just downgrade your MySQL workbench version.
In my case I downgraded the version from
8.0.25 to 8.0.20.
The sounds like you already had tried that script execution before and stopped it without stopping the mysqld process. So this process (which does the actual import) still holds a file lock on the temporary config file.
Try removing that file and check that all MySQL processes that you don't want are stopped. Then try again.
It seems the actual issue is not related to MySQL itself, but to MySQL Workbench.
The error you're seeing is a generic error coming from Windows itself, not from MySQL. It's unclear how you're running MySQL, for example is it in your localhost, in a Docker environment, or in a remote server.
It seems clear that at least two processes are trying to get an exclusive lock on that temporary file. My guess is that MySQL won't write temporary files to the user folder we're seeing (with your username Pratik).
On Windows, MySQL checks in order the values of the TMPDIR, TEMP, and TMP environment variables. For the first one found to be set, MySQL uses it and does not check those remaining. If none of TMPDIR, TEMP, or TMP are set, MySQL uses the Windows system default, which is usually C:\windows\temp.
Something you can do is to change your MySQL configuration so it uses a specific Temporary path you'll set, restart MySQL and retry running the query. If you see the error contains your new temporary path you've isolated the issue, it is indeed a MySQL problem. If you keep seeing this path you've isolated the issue to MySQL WorkBench.
An alternative approach would be to run the same query from another MySQL client, for example the command-line client mysql; and see if you're getting the same error.
Probably the simpler approach would be to try the queries with dBeaver, another MySQL client, and use that to isolate the issue to either the MySQL server itself or MySQL WorkBench.
This is a common issue for the upgraded version of MySQL, Try using Open Script instead of Run Script and that seems to clear up the issue.
I've found that it was already reported in the official bug tracker: https://bugs.mysql.com/bug.php?id=104841.
I've just checked, and it's still present in MySQL Workbench 8.0.30.
Work Around
Do not try to open the SQL file from this tool bar:
Go to Server > Data Import:
select import from self-contained file
select your target schema
then start import (bottom right btn)

MySQL Workbench Data Export error. "Error executing task [Errno 2] No such file or directory"

I have a problem to export a small database using MySQL Workbench's Data Export function on Windows 10.
Previously I have had no problems exporting and importing databases, although after this happened I have changed the security of the server to legacy to get it working with phpMyAdmin using the MySQL Workbench Installer, which I have been unable to change back as when trying to execute the change I got an error stating the installer was unable to create the temporary user (running this as administrator didn't help).
Since then I have also updated MySQL Workbench, the server, and the rest of the components that were installed with it, which seems to have gotten rid of the MySQL Workbench Installer application, as such i am unable to provide the exact error it gave regarding being unable to create the temporary user.
I'm not 100% sure if the above is relevant to the issue but it does seem like it could be related.
The issue that I'm trying to fix is that MySQL Workbench will not export any (or all of) the databases I have set up to a self contained file. The error I keep getting is below:
09:47:47 Dumping va_form (all tables)
Error executing task [Errno 2] No such file or directory: u'D:\Mike\Desktop\Dump20190226.sql'
09:47:47 Export of D:\Mike\Desktop\Dump20190226.sql has finished
I was previously getting a similar error about access denied, which then lead me to change the default dump directory to my desktop, as I'm only going to need to dump files occasionally and sort and send them elsewhere straight away.
I have also tried disabling column-statistics and lock-tables although this has had no effect.
As you can see, at the start of the directory it's trying to dump to it says "u'D:\\" - I am not sure if this leading u is significant, although it is not there in the directory I have specified to dump the file to.
I'm hoping someone here has some insight into this issue, I have no idea why MySQL Workbench's installer was refusing to make the temporary user (even when being run as administrator) and why I cannot find the installer now, as well as the obvious problem of why MySQL workbench is unable to create the file to dump anywhere on the system.
Thanks very much for your time reading this.
It is probably an issue with a recent update of Windows Defender, not with MySQL.
Try to save your dump to folders located somewhere else than Desktop or Documents (I usually send them directly to a cloud service integrated with my OS). If this works, you just need to add an exception for MySQL in Windows Defender.

SQL Server 2008 R2 database not accessible after instance started

This is a bit of a problem! I had shut down an instance on SQL Server and today I started it up again.
However one of the databases (the main one that I work with) is not accessible.
When I attempt to expand the database in SSMS to view tables, I get the error:
The database is not accessible. (objectExplorer)
I found this article which looked like it may solve the issue (assuming that it is a permissions issue) but that did not work either: http://sqlserver-help.com/2012/02/08/help-i-lost-sa-password-and-no-one-has-system-administrator-sysadmin-permission-what-should-i-do/
In the SQL Server error logs I am seeing:
FCB:Open failed: Could not open file E:\\.mdf for file number 1. OS error: 32 The process cannot access the file because it is being used by another process.
There is plenty disk space and so I am stuck with what the issue is.
I do have a recent backup so I'm not overly concerned about losing this database but still - I would like to be able to recover it if at all possible.,
Any help appreciated.
UPDATE - I used ProcessExplorer which showed that sqlservr.exe is using the file EVEN AFTER STOPPING THE SERVICE!
When I attempt to detach the database I get an error about Primary files do not match or that log file is from different database. Confusing!
Thanks.
No idea what the issue was still - but it was resolved by rebuilding the log file.

Log warnings into a table

I found the following code on mysql forge site.
MySQL Proxy : An easy way to log all warnings and errors into a MySQL table.
http://forge.mysql.com/tools/tool.php?id=133
This may sound too basic, but from where do I start if I need this functionality.
Here you have more details about MySQL proxy scripting.
What you need to do with the script you linked is just run it on MySQL database and it will do all the magic for you. It's a complete server side solution so you don't have to worry about logging errors in your client application. MySQL will automatically run read_query function for every row returned and read_query_result for every set returned.