Description:
mysql_install_db fails with "Can't create/write to file" error if no recursive read permission to installation folder.
Extract from log below:
Please wait while Setup installs MySQL Enterprise Monitor on your computer.
Installing
0% ______________ 50% ______________ 100%
########################################
Error: Error running
/opt/mysql/enterprise/monitor/mysql/scripts/mysql_install_db
--defaults-file=/opt/mysql/enterprise/monitor/mysql/my.cnf --user=mysql : ERROR:
1 Can't create/write to file
'/opt/mysql/enterprise/monitor/mysql/data/mysql/db.MYI' (Errcode: 13)
090203 12:47:32 [ERROR] Aborting
090203 12:47:32 [Note] /opt/mysql/enterprise/monitor/mysql//bin/mysqld: Shutdown
complete
Press [Enter] to continue :
#
----------------------------------------------------------------------------
Completed installing files
How to repeat:
1. Log in as root user
2.
mkdir /testinstall
chmod 700 /testinstall
3. run installer --mode text and select /testinstall as destination folder
While steps above may look artificial, on my Ubuntu installer didn't work for default installation folder: /opt/mysql/enterprise/monitor
Suggested fix:
make installer working properly.
workaroud:
1. uninstall failed installation
2. provide read permission to all folders (including 'monitor' folder), e.g.:
chmod 755 /testinstall
mkdir /testinstall/monitor
chmod 755 /testinstall/monitor
3.
repeat installation again
4.
remove read permissions if needed (<- not tested)
Trying to fix mysql installation leaded to problem that tomcat refused to connect to mysql (username was not set properly?). So I didn't investigate further since full reinstall looks simpler.