mirror of
https://github.com/webmin/webmin.git
synced 2025-08-19 01:15:14 +00:00
Add button to restart mysql https://github.com/webmin/webmin/issues/2309
This commit is contained in:
@ -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'});
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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'};
|
||||
}
|
||||
|
13
mysql/restart.cgi
Executable file
13
mysql/restart.cgi
Executable file
@ -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("");
|
||||
|
Reference in New Issue
Block a user