summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-db/mysql/mysql-5.7.21.ebuild19
1 files changed, 4 insertions, 15 deletions
diff --git a/dev-db/mysql/mysql-5.7.21.ebuild b/dev-db/mysql/mysql-5.7.21.ebuild
index 1d1eaac..681748a 100644
--- a/dev-db/mysql/mysql-5.7.21.ebuild
+++ b/dev-db/mysql/mysql-5.7.21.ebuild
@@ -791,8 +791,9 @@ pkg_config() {
# http://dev.mysql.com/doc/mysql/en/time-zone-support.html
"${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
- local cmd=( "${EROOT}usr/share/mysql/scripts/mysql_install_db" )
- [[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
+ # --initialize-insecure will not set root password
+ # --initialize would set a random one in the log which we don't need as we set it ourselves
+ local cmd=( "${EROOT}usr/sbin/mysqld" "--initialize-insecure" "--init-file='${sqltmp}'" )
cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
einfo "Command: ${cmd[*]}"
su -s /bin/sh -c "${cmd[*]}" mysql \
@@ -811,6 +812,7 @@ pkg_config() {
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
local mysqld="${EROOT}/usr/sbin/mysqld \
${options} \
+ $(use prefix || echo --user=mysql) \
--log-warnings=0 \
--basedir=${EROOT}/usr \
--datadir=${ROOT}/${MY_DATADIR} \
@@ -844,19 +846,6 @@ pkg_config() {
-e "${sql}"
eend $?
- if [[ -n "${sqltmp}" ]] ; then
- ebegin "Loading \"zoneinfo\", this step may require a few seconds"
- "${EROOT}/usr/bin/mysql" \
- "--socket=${socket}" \
- -hlocalhost \
- -uroot \
- --password="${MYSQL_ROOT_PASSWORD}" \
- mysql < "${sqltmp}"
- rc=$?
- eend $?
- [[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
- fi
-
# Stop the server and cleanup
einfo "Stopping the server ..."
kill $(< "${pidfile}" )