chmod 751 "$MYSQL_CLUSTER_DIR" "$MYSQL_CLUSTER_DIR/mysqldb"
if [ -f /usr/share/mysql/mysqld.conf -a ! -f "$MYSQL_CLUSTER_DIR/mysqld.conf" ]; then
- sed -e "s#datadir.*=.*#datadir = $MYSQL_DATA_DIR#g" \
- -e "s#pid-file.*=.*#pid-file = $MYSQL_PIDFILE#g" \
- -e "s#socket.*=.*#socket = $MYSQL_SOCKET#g" \
+ sed -e "s#\(datadir.*\)=.*#\1= $MYSQL_DATA_DIR#g" \
+ -e "s#\(pid-file.*\)=.*#\1= $MYSQL_PIDFILE#g" \
+ -e "s#\(socket.*\)=.*#\1= $MYSQL_SOCKET#g" \
/usr/share/mysql/mysqld.conf > "$MYSQL_CLUSTER_DIR/mysqld.conf"
chown root:root "$MYSQL_CLUSTER_DIR/mysqld.conf"
chmod 640 "$MYSQL_CLUSTER_DIR/mysqld.conf"
cat << END_OF_MSG
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL USERS!
-This is done (after starting database) with:
+This is done (after starting database; press enter when asked for password) with:
-/usr/bin/mysqladmin -u mysql -S $MYSQL_SOCKET password 'password'
-/usr/bin/mysqladmin -h $hostname -u mysql -S $MYSQL_SOCKET password 'password'
-/usr/bin/mysqladmin -u mysql_logrotate -S $MYSQL_SOCKET password 'password'
+/usr/bin/mysqladmin -u mysql -p -S $MYSQL_SOCKET password 'password'
+/usr/bin/mysqladmin -h $hostname -u mysql -p -S $MYSQL_SOCKET password 'password'
+/usr/bin/mysqladmin -u mysql_logrotate -p -S $MYSQL_SOCKET password 'password'
NOTE: mysql_logrotate password should be placed to $MYSQL_CONFIG in
mysqladmin section. See the manual for more instructions.