I changed the value of mysql's general_log_file variable to something else, and now I'm trying to change it back to what it was originally, /var/lib/mysql/ubuntu.log. But when I do:

SET GLOBAL general_log_file = '/var/lib/msyql/ubuntu.log';

I get this error:

ERROR 1231 (42000): Variable 'general_log_file' can't be set to the value of '/var/lib/msyql/ubuntu.log'

What's going on?


ERROR 1231 (42000): Variable 'general_log_file' can't be set to the value of '/var/lib/msyql/ubuntu.log'

What's going on?

The simple answer is this file doesn't exist.

You type too fast. There is a typo in the file name, it should be /var/lib/mysql/ubuntu.log.

  • 1
    If the folder exists, it might need appropriate permissions for the mysql user (or whoever owns the mysqld process) to write to it. – mwfearnley Apr 18 '19 at 12:03

I know this is a very old answer, but just in case someone else will be looking for an answer here.

In my case - the problem was in permissions that wasn't correct on the destination folder.

  • 2
    I'd upvote your answer if you could be more precise about what permissions you had, and what you found you needed (and that wasn't 777). – MadHatter Jul 6 '15 at 10:20
  • 1
    I had permission for root only to write into that directory. meaning mysql user had no permission to write to it. From here - you have several options to fix this. add 777 permissions (as i did) or create a directory for the mysql user to write to it. – Tata Jul 6 '15 at 12:09
  • 777 permissions is a very poor idea indeed. – MadHatter Jul 6 '15 at 12:12
  • 1
    in my case - it was not bad idea at all, as this is a "junk" folder that i want to write to it from anywhere. I wasn't setting the file to be written to /var/lib/mysql/ubuntu.log as in the question, that is why i didn't added the idea of 777 at the first place. just noting that even if the folder exists - it worth checking that it has correct permissions. – Tata Jul 6 '15 at 12:13

My issue was I was trying to create a log file on my local machine when I was running mysql in a Docker container. I was able to launch the CLI for docker and get into container and tail the log file there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.