Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql initialization error [1] Can't find error-message file & # 39 * * usr *

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Environment: CentOS 7.2

MySQL 5.7.18

Download the rpm package from the mysql official website and install the following RPM package locally on the server:

Mysql-community-common-5.7.18-1.el7.x86_64.rpm

Mysql-community-server-5.7.18-1.el7.x86_64.rpm

Mysql-community-client-5.7.18-1.el7.x86_64.rpm

Mysql-community-libs-5.7.18-1.el7.x86_64.rpm

Mysql-community-devel-5.7.18-1.el7.x86_64.rpm

After the yum installation is complete, initialize:

Mysqld-initialize

Since the configuration file my.cnf for mysql has been configured after yum installation, the my.cnf file is copied directly to / etc/. However, during the initialization process, check the error log and find that an error is reported:

[ERROR] Can't find error-message file'/ usr/local/mysql/share/mysql/errmsg.sys'.

Check error-message file location and 'lc-messages-dir' configuration directive

After querying the official website, the errmsg.sys log is generated by the project comp_err, which is automatically generated during the mysql creation process. I first find it, but I don't have any file information. After Google, I specify the value of the lc-message-dir parameter in my.cnf according to the above alarm information, and then restart, but the error log still reports an error and prompts Can't find. Errmsg.sys, and then I touch created this file, rebooted and reported an error Can't read.

Then I sent this question to the technical group to ask. A great god told me that all kinds of errors during initialization are mainly caused by incorrect parameter configuration, so it is suggested that I should slowly eliminate them according to the configuration parameters in my.cnf.

Later, I found that at the beginning, the log error report was:

[ERROR] Can't find error-message file'/ usr/local/mysql/share/mysql/errmsg.sys'.

At this time, I was thinking about how the two share/mysql directories came from, because the basedir and datadir specified in my parameters contain two subdirectories, but I'm sure this file is related to basedir, because my basedir specifies / usr/local/mysql/. It suddenly occurred to me that basedir specifies the files that are listed in the bin,lib of the database, but because I am installed by yum, the default path for all these files is under / usr/share/mysql, so the parameter basedir does not need to be specified, or it can be directly specified under the / usr/share/mysql/ directory.

Then I made a change at my.cnf:

# basedir=/usr/local/mysql comments out the basedir, then reinitializes or restarts the mysqld.

Sure enough, there was no such error in the log.

As for the specified basedir=/usr/share/mysql has been verified, the specified word will still report an error.

[ERROR] Can't find error-message file'/ usr/share/mysql/share/mysql/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive

Add No. 20170724:

Today, this error also occurred in the binary installation of mysql5.6.36. I found that this error could not be solved according to the above scheme. Then I went to google to take a look at the mysql5.6 binary installation tutorial, and then found that it was basically put in / usr/local/mysql after decompressing the mysql5.6 binary package, and then specify basedir=/usr/local/mysql/, during mysql_install_db initialization, and then I suddenly remembered the definition of basedir. Basedir mainly stores the path of initialization and installation of mysql, because my mysql is binary installed, so I guess my basedir should be the directory after the binary package is decompressed. In the configuration file, I connect the directory behind the basedir file to the path of the directory after I decompress, and there is no error after rebooting.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report