MySQL Forums
Forum List  »  Source, Builds, Binaries

5.7.43 on Ubuntu. Start option --log-error works abnormally, causing mysqld start failed
Posted by: shen jevon
Date: October 29, 2023 09:14PM

I don't know why option --log-error works uncorrectly, following cmd shows how i start mysqld and debug


All Started by
jevon@Kubuntu:/mnt/WorkSpace/Source_Code/mysql-server-5.7$ ./Build/sql/mysqld --user=jevon --sql-mode=NO_AUTO_CREATE_USER --port=9200 --socket=/mnt/WorkSpace/Source_Code/mysql-server-5.7/Build/Runtime_Location/server.socket --pid-file=/mnt/WorkSpace/Source_Code/mysql-server-5.7/Build/Runtime_Location/server.pid --basedir=/mnt/WorkSpace/Source_Code/mysql-server-5.7/Build/Runtime_Location --datadir=/mnt/WorkSpace/Source_Code/mysql-server-5.7/Build/Runtime_Location/data --lc-messages-dir=/mnt/WorkSpace/Source_Code/mysql-server-5.7/Build/sql/share
2023-10-30T02:31:07.925426Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-10-30T02:31:07.927278Z 0 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
2023-10-30T02:31:07.927311Z 0 [Note] ./Build/sql/mysqld (mysqld 5.7.43-debug) starting as process 78003 ...
2023-10-30T02:31:07.928965Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' for error logging: Permission denied
2023-10-30T02:31:07.928999Z 0 [ERROR] Aborting

2023-10-30T02:31:07.943199Z 0 [Note] Binlog end
2023-10-30T02:31:07.961609Z 0 [Note] ./Build/sql/mysqld: Shutdown complete


This is how i start the second instance mysqld which is Builted when i already have an existing mysqld8.0 running
This Log : [ERROR] Could not open file '/var/log/mysql/error.log' is caused by log-error option i think.
I want to log error message on stderr so i did't create error.log and did't use --log-error

I Checked mysqld.cc:3846(maybe)
bool log_errors_to_file = !opt_help && (log_error_dest != disabled_my_option);

According to the comment above :
/*
Enable old-fashioned error log, except when the user has requested
help information. Since the implementation of plugin server
variables the help output is now written much later.

log_error_dest can be:
disabled_my_option --log-error was not used or --log-error=
"" --log-error without arguments (no '=')
filename --log-error=filename
*/
i didn't used --log-error option, so variable: log_error_dest should be equal to variable: disabled_my_option whick is '0' and cause variable: log_errors_to_file = false.
But i checked variable: log_error_dest is still /var/log/mysql/error.log which is the default value of this option.
And i also tryed "--log-error=", but still /var/log/mysql/error.log
It does't work correctly

However i used --log-error="0", it works well
mysqld started with no problems.Because variable: log_errors_to_file = false and aviod open errorlogs.

So why does " --log-error was not used or --log-error=" doesn't work?
Is there anythis i did wrong or missing some step?
(I use vscode to debug and using args "--log-error=\"0\"",it works well)
Plz give me some advice Thx

Options: ReplyQuote


Subject
Views
Written By
Posted
5.7.43 on Ubuntu. Start option --log-error works abnormally, causing mysqld start failed
1335
October 29, 2023 09:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.