diff --git a/mysql/index.cgi b/mysql/index.cgi index 0d8704094..50f32ed4d 100755 --- a/mysql/index.cgi +++ b/mysql/index.cgi @@ -300,6 +300,9 @@ else { # Show stop button if ($access{'stop'} && &is_mysql_local()) { + print &ui_buttons_row("restart.cgi", $text{'index_restart'}, + $text{'index_restartmsg'}); + print &ui_buttons_row("stop.cgi", $text{'index_stop'}, $text{'index_stopmsg'}); } diff --git a/mysql/lang/en b/mysql/lang/en index 2a4d5b0fa..a63ad96f1 100644 --- a/mysql/lang/en +++ b/mysql/lang/en @@ -9,6 +9,8 @@ index_pass=Password index_clear=Clear index_stop=Stop MySQL Server index_stopmsg=Click this button to stop the MySQL database server on your system. This will prevent any users or programs from accessing the database, including this Webmin module. +index_restart=Resart MySQL Server +index_restartmsg=Click this button to restart the MySQL database server on your system. All clients will be disconnected, and any configuration files will be reloaded. index_dbs=MySQL Databases index_add=Create a new database. index_global=Global Options @@ -540,6 +542,7 @@ acl_views=Can view and manage views? acl_files=Can execute SQL from local files? log_start=Started MySQL server +log_restart=Restarted MySQL server log_stop=Stopped MySQL server log_cnf=Changed MySQL server configuration log_ssl=Changed SSL certificate diff --git a/mysql/log_parser.pl b/mysql/log_parser.pl index 33e976f95..42e1213a1 100755 --- a/mysql/log_parser.pl +++ b/mysql/log_parser.pl @@ -14,6 +14,9 @@ if ($action eq 'stop') { elsif ($action eq 'start') { return $text{'log_start'}; } +elsif ($action eq 'restart') { + return $text{'log_restart'}; + } elsif ($action eq 'cnf') { return $text{'log_cnf'}; } diff --git a/mysql/restart.cgi b/mysql/restart.cgi new file mode 100755 index 000000000..95ed109a7 --- /dev/null +++ b/mysql/restart.cgi @@ -0,0 +1,13 @@ +#!/usr/local/bin/perl +# Restart the MySQL database server + +require './mysql-lib.pl'; +&error_setup($text{'restart_err'}); +$err = &stop_mysql(); +&error($err) if ($err); +$err = &start_mysql(); +&error($err) if ($err); +sleep(3); +&webmin_log("restart"); +&redirect(""); +