Variable 'general_log_file' can't be set to the value of '/var/lib/msyql/ubuntu.log'

18,132

Solution 1

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.

Solution 2

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.

Solution 3

This is what helped me in a similar situation:

  1. Create a new folder somewhere on your machine, like so (of course, you can name the folder anything you want):

$ mkdir ~/log_files

  1. Change ownership of this folder to mysql:

$ chown mysql: ~/log_files

  1. Set the the variable general_log_file to the folder you just created in your mysql console, like so:

mysql> SET GLOBAL general_log_file = '~/log_files/mysql_log.log';

  1. Restart mysql (terminal command can be googled for your specific setup, e.g. by searching for "bitnami mysql restart")

  2. Check, if the log file exists in the folder you created in step 1

I hope it helps!

Share:
18,132

Related videos on Youtube

XåpplI'-I0llwlg'I  -
Author by

XåpplI'-I0llwlg'I -

im bill grates of michaelsoft

Updated on September 18, 2022

Comments

  • XåpplI'-I0llwlg'I  -
    XåpplI'-I0llwlg'I - almost 2 years

    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?

  • MadHatter
    MadHatter almost 9 years
    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).
  • Tata
    Tata almost 9 years
    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.
  • MadHatter
    MadHatter almost 9 years
    777 permissions is a very poor idea indeed.
  • Tata
    Tata almost 9 years
    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.