Use mysqld instead of mysqld_safe (mysqld_safe not necessary for 5.7)

Use mysqld --initialize-insecure instead of mysql_install_db
  Create /var/lib/mysql-files (used by secure-file-priv)
    http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_secure_file_priv
  Remove unnecessary Perl dependencies (mysqlhotcopy was removed in 5.7)
  Thanks Norvald H. Ryeng
This commit is contained in:
Honza Horak 2016-01-27 19:36:20 +01:00
parent bbb2a971c0
commit 1d9080ea5c
3 changed files with 14 additions and 7 deletions

View File

@ -80,7 +80,7 @@
Name: community-mysql
Version: 5.7.10
Release: 1%{?with_debug:.debug}%{?dist}
Release: 2%{?with_debug:.debug}%{?dist}
Summary: MySQL client programs and shared libraries
Group: Applications/Databases
URL: http://www.mysql.com
@ -284,9 +284,6 @@ Requires: systemd
# Make sure it's there when scriptlets run, too
%{?systemd_requires: %systemd_requires}
%endif
# mysqlhotcopy needs DBI/DBD support
Requires: perl(DBI)
Requires: perl(DBD::mysql)
%if %{with mysql_names}
Provides: mysql-server = %{sameevr}
Provides: mysql-server%{?_isa} = %{sameevr}
@ -684,6 +681,7 @@ touch %{buildroot}%{logfile}
mkdir -p %{buildroot}%{pidfiledir}
install -p -m 0755 -d %{buildroot}%{dbdatadir}
install -p -m 0750 -d %{buildroot}%{_localstatedir}/lib/mysql-files
%if %{with config}
install -D -p -m 0644 scripts/my.cnf %{buildroot}%{_sysconfdir}/my.cnf
@ -1046,6 +1044,7 @@ fi
%{_tmpfilesdir}/mysql.conf
%{?with_init_systemd:%{_tmpfilesdir}/%{name}.conf}
%attr(0755,mysql,mysql) %dir %{dbdatadir}
%attr(0750,mysql,mysql) %dir %{_localstatedir}/lib/mysql-files
%attr(0755,mysql,mysql) %dir %{pidfiledir}
%attr(0640,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{logfile}
%config(noreplace) %{logrotateddir}/%{daemon_name}
@ -1084,6 +1083,14 @@ fi
%endif
%changelog
* Wed Jan 27 2016 Honza Horak <hhorak@redhat.com> - 5.7.10-2
- Use mysqld instead of mysqld_safe (mysqld_safe not necessary for 5.7)
Use mysqld --initialize-insecure instead of mysql_install_db
Create /var/lib/mysql-files (used by secure-file-priv)
http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_secure_file_priv
Remove unnecessary Perl dependencies (mysqlhotcopy was removed in 5.7)
Thanks Norvald H. Ryeng
* Wed Dec 16 2015 Jakub Dorňák <jdornak@redhat.com> - 5.7.10-1
- Update to 5.7.10

View File

@ -69,7 +69,7 @@ if [ ! -d "$datadir/mysql" ] ; then
# Now create the database
echo "Initializing @NICE_PROJECT_NAME@ database"
@bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser"
@libexecdir@/mysqld --initialize-insecure --datadir="$datadir" --user="$myuser"
ret=$?
if [ $ret -ne 0 ] ; then
echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2

View File

@ -28,7 +28,7 @@ After=syslog.target
After=network.target
[Service]
Type=simple
Type=forking
User=mysql
Group=mysql
@ -39,7 +39,7 @@ ExecStartPre=@libexecdir@/mysql-check-socket
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart=@bindir@/mysqld_safe --basedir=@prefix@
ExecStart=@libexecdir@/mysqld --daemonize --basedir=@prefix@
ExecStartPost=@libexecdir@/mysql-wait-ready $MAINPID
ExecStartPost=@libexecdir@/mysql-check-upgrade
ExecStopPost=@libexecdir@/mysql-wait-stop