Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 339371 | Differences between
and this patch

Collapse All | Expand All

(-)/home/camorup/.gentoo/usr/portage/eclass/mysql.eclass (-9 / +3 lines)
Lines 1271-1277 Link Here
1271
	popd &>/dev/null
1271
	popd &>/dev/null
1272
	[[ -f "${EROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
1272
	[[ -f "${EROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
1273
	|| die "MySQL databases not installed"
1273
	|| die "MySQL databases not installed"
1274
	chown -R mysql:mysql "${EROOT}/${MY_DATADIR}" 2>/dev/null
1274
	use prefix || chown -R mysql:mysql "${EROOT}/${MY_DATADIR}" 2>/dev/null
1275
	chmod 0750 "${EROOT}/${MY_DATADIR}" 2>/dev/null
1275
	chmod 0750 "${EROOT}/${MY_DATADIR}" 2>/dev/null
1276
1276
1277
	# Figure out which options we need to disable to do the setup
1277
	# Figure out which options we need to disable to do the setup
Lines 1306-1312 Link Here
1306
	local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
1306
	local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
1307
	local mysqld="${EROOT}/usr/sbin/mysqld \
1307
	local mysqld="${EROOT}/usr/sbin/mysqld \
1308
		${options} \
1308
		${options} \
1309
		--user=mysql \
1310
		--basedir=${EROOT}/usr \
1309
		--basedir=${EROOT}/usr \
1311
		--datadir=${EROOT}/${MY_DATADIR} \
1310
		--datadir=${EROOT}/${MY_DATADIR} \
1312
		--max_allowed_packet=8M \
1311
		--max_allowed_packet=8M \
Lines 1330-1348 Link Here
1330
	fi
1329
	fi
1331
1330
1332
	ebegin "Setting root password"
1331
	ebegin "Setting root password"
1333
	# Do this from memory, as we don't want clear text passwords in temp files
1332
	"${EROOT}/usr/bin/mysqladmin" --socket="${socket}" --user=root password "${MYSQL_ROOT_PASSWORD}"
1334
	local sql="UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWORD}') WHERE USER='root'"
1335
	"${EROOT}/usr/bin/mysql" \
1336
		--socket=${socket} \
1337
		-hlocalhost \
1338
		-e "${sql}"
1339
	eend $?
1333
	eend $?
1340
1334
1341
	ebegin "Loading \"zoneinfo\", this step may require a few seconds ..."
1335
	ebegin "Loading \"zoneinfo\", this step may require a few seconds ..."
1342
	"${EROOT}/usr/bin/mysql" \
1336
	"${EROOT}/usr/bin/mysql" \
1343
		--socket=${socket} \
1337
		--socket=${socket} \
1344
		-hlocalhost \
1338
		-hlocalhost \
1345
	
1339
		-uroot \	
1346
		-p"${MYSQL_ROOT_PASSWORD}" \
1340
		-p"${MYSQL_ROOT_PASSWORD}" \
1347
		mysql < "${sqltmp}"
1341
		mysql < "${sqltmp}"
1348
	rc=$?
1342
	rc=$?

Return to bug 339371