mysql/ 0000755 0005671 0000012 00000000000 11220734045 011701 5 ustar jcameron wheel mysql/config-sol-linux 0000664 0005671 0000012 00000000663 11220734044 015027 0 ustar jcameron wheel start_cmd=/etc/rc.d/bin/mysqld up
stop_cmd=/etc/rc.d/bin/mysqld down
mysql=/server/mysql/bin/mysql
mysqldump=/server/mysql/bin/mysqldump
mysqlimport=/server/mysql/bin/mysqlimport
mysql_libs=
mysqladmin=/server/mysql/bin/mysqladmin
mysqlshow=/server/mysql/bin/mysqlshow
perpage=25
style=0
add_mode=1
nodbi=0
access=*: *
blob_mode=0
date_subs=0
passwd_mode=0
mysql_data=/var/lib/mysql
max_dbs=50
my_cnf=/etc/my.cnf
max_text=1000
nopwd=0
mysql/backup_db.cgi 0000775 0005671 0000012 00000014223 11220734044 014305 0 ustar jcameron wheel #!/usr/local/bin/perl
# backup_db.cgi
# Do the actual backup
require './mysql-lib.pl';
&ReadParse();
if ($in{'all'}) {
@alldbs = &list_databases();
@dbs = grep { &can_edit_db($_) } @alldbs;
@alldbs == @dbs || &error($text{'dbase_ecannot'});
}
else {
&can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'});
}
$access{'edonly'} && &error($text{'dbase_ecannot'});
$access{'buser'} || &error($text{'dbase_ecannot'});
&error_setup($text{'backup_err'});
if (!$in{'save'} || $in{'sched'}) {
if ($in{'all'}) {
-d $in{'file'} || -d &date_subs($in{'file'}) || $in{'mkdir'} ||
&error($text{'backup_efile2'});
}
else {
$in{'file'} =~ /^\/\S+$/ || &error($text{'backup_efile'});
}
$in{'where_def'} || $in{'where'} || &error($text{'backup_ewhere'});
$in{'charset_def'} || $in{'charset'} =~ /^\S+$/ ||
&error($text{'backup_echarset'});
$ccmd = $in{'compress'} == 1 ? "gzip" :
$in{'compress'} == 2 ? "bzip2" : undef;
!$ccmd || &has_command($ccmd) ||
&error(&text('backup_eccmd', "$ccmd"));
if (!&is_under_directory($access{'bpath'}, $in{'file'})) {
&error($text{'backup_epath'}."
".
&text('backup_eunder', "$access{'bpath'}"));
}
if (!$in{'all'} && !$in{'tables_def'}) {
@tables = split(/\0/, $in{'tables'});
@tables || &error($text{'backup_etables'});
}
}
@compat = $in{'compatible_def'} ? ( ) : ( $in{'compatible'} );
push(@compat, split(/\0/, $in{'options'}));
$cron = !$module_info{'usermin'} && $access{'buser'} eq 'root' &&
!$access{'user'} && &foreign_installed("cron");
$cmode = 0;
if ($cron) {
$config{'backup_before_'.$in{'db'}} = $in{'before'};
$config{'backup_after_'.$in{'db'}} = $in{'after'};
if ($in{'all'}) {
$config{'backup_cmode_'.$in{'db'}} = $in{'cmode'};
$cmode = $in{'cmode'};
}
&foreign_require("cron", "cron-lib.pl");
@jobs = &cron::list_cron_jobs();
$cmd = $in{'all'} ? "$cron_cmd --all" : "$cron_cmd $in{'db'}";
($job) = grep { $_->{'command'} eq $cmd } @jobs;
$oldjob = $job;
$job ||= { 'command' => $cmd,
'user' => 'root',
'active' => 1 };
&cron::parse_times_input($job, \%in);
}
# Save choices for next time the form is visited (and for the cron job)
if ($module_info{'usermin'}) {
$userconfig{'backup_'.$in{'db'}} = $in{'file'};
$userconfig{'backup_where_'.$in{'db'}} =
$in{'where_def'} ? undef : $in{'where'};
$userconfig{'backup_charset_'.$in{'db'}} =
$in{'charset_def'} ? undef : $in{'charset'};
$userconfig{'backup_compatible_'.$in{'db'}} =
$in{'compatible_def'} ? undef : $in{'compatible'};
$userconfig{'backup_options_'.$in{'db'}} =
join(" ", split(/\0/, $in{'options'}));
$userconfig{'backup_compress_'.$in{'db'}} = $in{'compress'};
$userconfig{'backup_drop_'.$in{'db'}} = $in{'drop'};
$userconfig{'backup_tables_'.$in{'db'}} = join(" ", @tables);
&write_file("$user_module_config_directory/config", \%userconfig);
}
else {
$config{'backup_'.$in{'db'}} = $in{'file'};
$config{'backup_mkdir_'.$in{'db'}} = $in{'mkdir'};
$config{'backup_where_'.$in{'db'}} =
$in{'where_def'} ? undef : $in{'where'};
$config{'backup_charset_'.$in{'db'}} =
$in{'charset_def'} ? undef : $in{'charset'};
$config{'backup_compatible_'.$in{'db'}} =
$in{'compatible_def'} ? undef : $in{'compatible'};
$config{'backup_options_'.$in{'db'}} =
join(" ", split(/\0/, $in{'options'}));
$config{'backup_compress_'.$in{'db'}} = $in{'compress'};
$config{'backup_drop_'.$in{'db'}} = $in{'drop'};
$config{'backup_tables_'.$in{'db'}} = join(" ", @tables);
&write_file("$module_config_directory/config", \%config);
}
&ui_print_header(undef, $text{'backup_title'}, "");
if (!$in{'save'}) {
# Actually execute the backup now
@dbs = $in{'all'} ? @alldbs : ( $in{'db'} );
if ($cmode == 1) {
# Run and check before-backup command (for all DBs)
$bok = &execute_before(undef, STDOUT, 1, $in{'file'}, undef);
if (!$bok) {
print "$main::whatfailed : ",$text{'backup_ebefore'},"
\n"; goto donebackup; } } foreach $db (@dbs) { if ($in{'all'}) { $dir = &date_subs($in{'file'}); &make_dir($dir, 0755) if ($in{'mkdir'}); $file = $dir."/".$db.".sql". ($in{'compress'} == 1 ? ".gz" : $in{'compress'} == 2 ? ".bz2" : ""); } else { $file = &date_subs($in{'file'}); } if ($cron && $cmode == 0) { # Run and check before-backup command (for one DB) $bok = &execute_before($db, STDOUT, 1, $file, $in{'all'} ? undef : $db); if (!$bok) { print "$main::whatfailed : ",$text{'backup_ebefore'},"
\n"; next; } } unlink($file); if ($in{'compress'} == 0) { $writer = ">$file"; } elsif ($in{'compress'} == 1) { $writer = "| gzip -c >$file"; } elsif ($in{'compress'} == 2) { $writer = "| bzip2 -c >$file"; } local $err = &backup_database($db, $file, $in{'compress'}, $in{'drop'}, $in{'where_def'} ? undef : $in{'where'}, $in{'charset_def'} ? undef : $in{'charset'}, \@compat, \@tables, $access{'buser'}); if ($err) { print "$main::whatfailed : ", &text('backup_ebackup',"
$err"),"
\n"; } else { @st = stat($file); print &text('backup_done', "$db", "$file", int($st[7])),"
\n"; } &execute_after($db, STDOUT, 1, $file, $in{'all'} ? undef : $db) if ($cron && $cmode == 0); } &execute_after(undef, STDOUT, 1, $in{'file'}, undef) if ($cmode == 1); donebackup: } if ($cron) { &lock_file($cron_cmd); &cron::create_wrapper($cron_cmd, $module_name, "backup.pl"); &unlock_file($cron_cmd); &lock_file(&cron::cron_file($job)); if ($in{'sched'} && !$oldjob) { &cron::create_cron_job($job); $what = "backup_ccron"; } elsif (!$in{'sched'} && $oldjob) { # Need to delete cron job &cron::delete_cron_job($job); $what = "backup_dcron"; } elsif ($in{'sched'} && $oldjob) { # Need to update cron job &cron::change_cron_job($job); $what = "backup_ucron"; } else { $what = "backup_ncron"; } &unlock_file(&cron::cron_file($job)); # Tell the user what was done print $text{$what},"
\n" if ($what); } &webmin_log("backup", undef, $in{'all'} ? "" : $in{'db'}, \%in); if ($in{'all'}) { &ui_print_footer("", $text{'index_return'}); } else { &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); } mysql/config.info.uk_UA 0000664 0005671 0000012 00000001540 11220734044 015027 0 ustar jcameron wheel mysqlimport= mysqlimport,0 start_cmd= MySQL,0 line1= , ,11 host= MySQL ',3,localhost line2= ,11 perpage=ʳ , ,0 sock= MySQL,3, mysqladmin= mysqladmin,0 mysql_libs= MySQL,3, style= ,1,1-,0- pass= ,12 stop_cmd= MySQL,3, nodbi= DBI '?,1,0-,1- mysqldump= mysqldump,0 mysqlshow= mysqlshow,0 mysql= mysql,0 login= ,0 add_mode= ,1,1-,0- mysql/config.info.tr 0000644 0005671 0000012 00000002073 11220734044 014450 0 ustar jcameron wheel line1=Yaplandrlabilir seenekler,11 login=Ynetici girii,0 pass=Ynetici ifresi,0 perpage=Sayfa bana gsterilecek olan satr says,0 style=Veritabanlar ve tablolar u ekilde gster,1,1-Liste,0-Simgeler add_mode=Dikey satr dzenleme arayzn kullan,1,1-Evet,0-Hayr blob_mode=Blob ve Metin alanlar u ekilde gster,1,0-Tablodaki veri,1-ndirilecek linkler nodbi=Eer mmknse DBI kullanlsn m?,1,0-Evet,1-Hayr date_subs=Yedekleme hedefleri iin strftime gsterimi kullanlsn?,1,1-Evet,0-Hayr passwd_mode=Parola hashing biimi,1,1-Eski,0-ntanml line2=Sistem yaplandrmas,11 mysqlshow=mysqlshow komutunun yolu,0 mysqladmin=mysqladmin komutunun yolu,0 mysql=mysql komutunun yolu,0 mysqldump=mysqldump komutunun yolu,0 mysqlimport=mysqlimport komutunun yolu,0 start_cmd=Mysql sunucusunu balatma komutu,0 stop_cmd=Mysql sunucusunu durdurma komutu,3,Otomatik mysql_libs=Mysql paylatrlm ktphanelerinin yeri,3,Hibiri host=Balanlacak MySQL sunucusu,3,localhost port=Balanlacak MySQL port numaras,3,ntanml sock=MySQL soket dosyas,3,ntanml mysql/config 0000644 0005671 0000012 00000000766 11220734044 013101 0 ustar jcameron wheel start_cmd=cd /usr/local/mysql ; (./bin/safe_mysqld || ./bin/mysqld_safe) & perpage=25 mysql=/usr/local/mysql/bin/mysql mysqldump=/usr/local/mysql/bin/mysqldump mysqlimport=/usr/local/mysql/bin/mysqlimport pass=foo mysqlshow=/usr/local/mysql/bin/mysqlshow login=root mysql_libs=/usr/local/mysql/lib mysqladmin=/usr/local/mysql/bin/mysqladmin style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/usr/local/mysql/var max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/config-openmamba-linux 0000664 0005671 0000012 00000000615 11220734044 016166 0 ustar jcameron wheel start_cmd=/etc/rc.d/init.d/mysql start stop_cmd=/etc/rc.d/init.d/mysql stop mysql=/usr/bin/mysql mysqldump=/usr/bin/mysqldump mysqlimport=/usr/bin/mysqlimport mysql_libs= mysqladmin=/usr/bin/mysqladmin mysqlshow=/usr/bin/mysqlshow perpage=25 style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/var/lib/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/acl_security.pl 0000775 0005671 0000012 00000010653 11220734044 014735 0 ustar jcameron wheel require 'mysql-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the mysql module sub acl_security_form { print "
\n"; } &ui_print_footer("", $text{'index_return'}); sub nice_time { local ($s) = @_; return sprintf "%2.2d:%2.2d:%2.2d", int($s / 3600), int($s / 60)%60, $s % 60; } mysql/edit_user.cgi 0000755 0005671 0000012 00000003750 11220734044 014357 0 ustar jcameron wheel #!/usr/local/bin/perl # edit_user.cgi # Display a form for editing or creating a MySQL user require './mysql-lib.pl'; &ReadParse(); $access{'perms'} == 1 || &error($text{'perms_ecannot'}); if ($in{'new'}) { &ui_print_header(undef, $text{'user_title1'}, "", "create_user"); } else { &ui_print_header(undef, $text{'user_title2'}, "", "edit_user"); if ($in{'user'}) { $d = &execute_sql_safe($master_db, "select * from user where user = ?", $in{'user'}); $u = $d->{'data'}->[0]; } else { $d = &execute_sql_safe($master_db, "select * from user order by user"); $u = $d->{'data'}->[$in{'idx'}]; } } # Form header print &ui_form_start("save_user.cgi", "post"); if ($in{'new'}) { print &ui_hidden("new", 1); } else { print &ui_hidden("olduser", $u->[1]); print &ui_hidden("oldhost", $u->[0]); } print &ui_table_start($text{'user_header'}, undef, 2); %sizes = &table_field_sizes($master_db, "user"); # Username field print &ui_table_row($text{'user_user'}, &ui_opt_textbox("mysqluser", $u->[1], $sizes{'user'}, $text{'user_all'})); # Password field print &ui_table_row($text{'user_pass'}, &ui_radio("mysqlpass_mode", $in{'new'} ? 0 : $u->[2] ? 1 : 2, [ [ 2, $text{'user_none'} ], $in{'new'} ? ( ) : ( [ 1, $text{'user_leave'} ] ), [ 0, $text{'user_set'} ] ])." ". &ui_password("mysqlpass", undef, 20)); # Allowed host / network print &ui_table_row($text{'user_host'}, &ui_opt_textbox("host", $u->[0] eq '%' ? '' : $u->[0], 40, $text{'user_any'})); # User's permissions for($i=3; $i<=&user_priv_cols()+3-1; $i++) { push(@opts, [ $i, $text{"user_priv$i"} ]); push(@sel, $i) if ($u->[$i] eq 'Y'); } print &ui_table_row($text{'user_perms'}, &ui_select("perms", \@sel, \@opts, 10, 1, 1)); print &ui_table_end(); print &ui_form_end([ $in{'new'} ? ( [ undef, $text{'create'} ] ) : ( [ undef, $text{'save'} ], [ 'delete', $text{'delete'} ] ) ]); &ui_print_footer('list_users.cgi', $text{'users_return'}, "", $text{'index_return'}); mysql/config_info.pl 0000775 0005671 0000012 00000001077 11220734044 014527 0 ustar jcameron wheel require './mysql-lib.pl'; sub show_charset { local ($value) = @_; local $main::error_must_die = 1; local @charsets; eval { @charsets = &list_character_sets(); }; if (@charsets) { @charsets = sort { $a->[1] cmp $b->[1] } @charsets; return &ui_select("charset", $value, [ [ "", "<$text{'default'}>" ], @charsets ]); } else { return &ui_opt_textbox("charset", $value, 20, $text{'default'}); } } sub parse_charset { if ($in{'charset_def'}) { return undef; } else { $in{'charset'} =~ /^\S*$/ || &error($text{'config_echarset'}); return $in{'charset'}; } } mysql/config-suse-linux 0000644 0005671 0000012 00000000605 11220734044 015203 0 ustar jcameron wheel start_cmd=/sbin/init.d/mysql start stop_cmd=/sbin/init.d/mysql stop mysql=/usr/bin/mysql mysqldump=/usr/bin/mysqldump mysqlimport=/usr/bin/mysqlimport mysql_libs= mysqladmin=/usr/bin/mysqladmin mysqlshow=/usr/bin/mysqlshow perpage=25 style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/var/lib/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/config-slackware-linux-8.0-* 0000644 0005671 0000012 00000000655 11220734044 016637 0 ustar jcameron wheel mysqlimport=/usr/bin/mysqlimport start_cmd=cd /usr ; (/usr/bin/safe_mysqld || /usr/bin/mysqld_safe) & perpage=25 mysqladmin=/usr/bin/mysqladmin style=0 mysql_libs= pass= mysqldump=/usr/bin/mysqldump mysqlshow=/usr/bin/mysqlshow mysql=/usr/bin/mysql login=root add_mode=1 host= sock= stop_cmd= nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/var/lib/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/config-freebsd 0000644 0005671 0000012 00000000713 11220734044 014501 0 ustar jcameron wheel start_cmd=(/usr/local/bin/safe_mysqld || /usr/local/bin/mysqld_safe) & perpage=25 mysql=/usr/local/bin/mysql mysqldump=/usr/local/bin/mysqldump mysqlimport=/usr/local/bin/mysqlimport mysqlshow=/usr/local/bin/mysqlshow login=root mysql_libs=/usr/local/lib/mysql mysqladmin=/usr/local/bin/mysqladmin style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/usr/local/var/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/config.info.zh_TW.Big5 0000644 0005671 0000012 00000001322 11220734044 015637 0 ustar jcameron wheel line1=պAﶵ,11 login=Ʈwz̦W,0 pass=ƮwẕKX,12 perpage=CܪC,0 style=ܸƮwP欰,1,1-M,0-ϥ add_mode=ϥΫCs褶,1,1-O,0-_ blob_mode=ܲb,1,0-椤,1-Us nodbi=pGiHܨϥDBIs?,1,0-O,1-_ date_subs=strftime Nƥؼ?,1,1-O,0-_ line2=tβպA,11 mysqlshow= mysqlshow O|,0 mysqladmin= mysqladmin O|,0 mysql= mysql O|,0 mysqldump=mysqldumpO|,0 mysqlimport=mysqlimportO|,0 start_cmd=Ұ MySQL ARO,0 stop_cmd= MySQL ARO,3,۰ mysql_libs= MySQL @ɨ禡w|,3,L host=sMySQLDD,3,a port=MySQLs,3,w] sock=MySQL socket ɮ,3,w] mysql/list_vars.cgi 0000775 0005671 0000012 00000003265 11220734044 014405 0 ustar jcameron wheel #!/usr/local/bin/perl # Show a list of MySQL runtime variables for editing require './mysql-lib.pl'; $access{'perms'} == 1 || &error($text{'vars_ecannot'}); &ui_print_header(undef, $text{'vars_title'}, "", "vars"); &ReadParse(); %d = map { $_, 1 } split(/\0/, $in{'d'}); # Work out which ones can be edited %canedit = map { $_->[0], 1 } &list_system_variables(); # Show search form print &ui_form_start("list_vars.cgi"); print "$text{'vars_search'} ", &ui_textbox("search", $in{'search'}, 20)," ", &ui_submit($text{'vars_ok'}); print &ui_form_end(); $d = &execute_sql($master_db, "show variables". ($in{'search'} ? " like '%".quotemeta($in{'search'})."%'" : "")); if (@{$d->{'data'}}) { print &ui_form_start("save_vars.cgi"); print &ui_hidden("search", $in{'search'}); @tds = ( "width=5" ); print &ui_columns_start([ "", $text{'vars_name'}, $text{'vars_value'} ], 100, 0, \@tds); foreach $v (@{$d->{'data'}}) { if (!$canedit{$v->[0]}) { # Cannot edit, so just show value print &ui_columns_row( [ "", $v->[0], &html_escape($v->[1]) ], \@tds); } elsif ($d{$v->[0]}) { # Editing now print &ui_columns_row([ "->", "[0]>$v->[0]", &ui_textbox("value_".$v->[0], $v->[1], 40) ], \@tds); } else { # Can edit print &ui_checked_columns_row([ "[0]>$v->[0]", &html_escape($v->[1]) ], \@tds, "d", $v->[0]); } } print &ui_columns_end(); print &ui_form_end([ [ "edit", $text{'vars_edit'} ], %d ? ( [ "save", $text{'save'} ] ) : ( ) ]); } else { print "",$in{'search'} ? $text{'vars_none2'} : $text{'vars_none'},"
\n"; } &ui_print_footer("", $text{'index_return'}); mysql/config.info.ru_RU 0000664 0005671 0000012 00000001473 11220734044 015064 0 ustar jcameron wheel mysqlimport= mysqlimport,0 start_cmd= MySQL,0 line1= ,11 host= MySQL ,3,localhost line2= ,11 perpage= , ,0 sock= MySQL,3, mysqladmin= mysqladmin,0 mysql_libs= MySQL,3, style= ,1,1-,0- pass= ,12 stop_cmd= MySQL,3, nodbi= DBI ?,1,0-,1- mysqldump= mysqldump,0 mysqlshow= mysqlshow,0 mysql= mysql,0 login= ,0 add_mode= ,1,1-,0- mysql/root_form.cgi 0000775 0005671 0000012 00000001426 11220734044 014402 0 ustar jcameron wheel #!/usr/local/bin/perl # Show a form for changing the MySQL root password require './mysql-lib.pl'; &ReadParse(); $access{'perms'} == 1 || &error($text{'perms_ecannot'}); &ui_print_header(undef, $text{'root_title'}, ""); print &ui_form_start("save_root.cgi", "post"); print &ui_table_start($text{'root_header'}, undef, 2); print &ui_table_row($text{'root_user'}, $mysql_login ? "$mysql_login" : "$text{'root_auto'}"); print &ui_table_row($text{'root_pass'}, $mysql_pass ? "$mysql_pass" : "$text{'root_none'}"); print &ui_table_row($text{'root_newpass1'}, &ui_password("newpass1", undef, 20)); print &ui_table_row($text{'root_newpass2'}, &ui_password("newpass2", undef, 20)); print &ui_table_end(); print &ui_form_end([ [ undef, $text{'root_ok'} ] ]); mysql/config-open-linux 0000644 0005671 0000012 00000000615 11220734044 015166 0 ustar jcameron wheel start_cmd=/etc/rc.d/init.d/mysql start stop_cmd=/etc/rc.d/init.d/mysql stop mysql=/usr/bin/mysql mysqldump=/usr/bin/mysqldump mysqlimport=/usr/bin/mysqlimport mysql_libs= mysqladmin=/usr/bin/mysqladmin mysqlshow=/usr/bin/mysqlshow perpage=25 style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/var/lib/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/edit_db.cgi 0000755 0005671 0000012 00000003245 11220734044 013765 0 ustar jcameron wheel #!/usr/local/bin/perl # edit_db.cgi # Edit or create a db table record require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'new'}) { &ui_print_header(undef, $text{'db_title1'}, "", "create_db"); } else { $d = &execute_sql_safe($master_db, "select * from db order by db"); $u = $d->{'data'}->[$in{'idx'}]; $access{'perms'} == 1 || &can_edit_db($u->[1]) || &error($text{'perms_edb'}); &ui_print_header(undef, $text{'db_title2'}, "", "edit_db"); } print &ui_form_start("save_db.cgi"); if ($in{'new'}) { print &ui_hidden("new", 1); } else { print &ui_hidden("oldhost", $u->[0]); print &ui_hidden("olddb", $u->[1]); print &ui_hidden("olduser", $u->[2]); } print &ui_table_start($text{'db_header'}, undef, 2); # Database name print &ui_table_row($text{'db_db'}, &select_db($u->[1])); # Apply to user print &ui_table_row($text{'db_user'}, &ui_opt_textbox("user", $u->[2], 20, $text{'db_anon'})); # Apply to hosts print &ui_table_row($text{'db_host'}, &ui_radio("host_mode", $u->[0] eq '' ? 0 : $u->[0] eq '%' ? 1 : 2, [ [ 0, $text{'db_hosts'} ], [ 1, $text{'db_any'} ], [ 2, &ui_textbox("host", $u->[0] eq '%' ? '' : $u->[0], 40) ] ])); # Permissions for DB for($i=3; $i<=&db_priv_cols()+3-1; $i++) { push(@opts, [ $i, $text{"db_priv$i"} ]); push(@sel, $i) if ($u->[$i] eq 'Y'); } print &ui_table_row($text{'db_perms'}, &ui_select("perms", \@sel, \@opts, 10, 1, 1)); print &ui_table_end(); print &ui_form_end([ $in{'new'} ? ( [ undef, $text{'create'} ] ) : ( [ undef, $text{'save'} ], [ 'delete', $text{'delete'} ] ) ]); &ui_print_footer('list_dbs.cgi', $text{'dbs_return'}, "", $text{'index_return'}); mysql/config-suse-linux-7.1-* 0000644 0005671 0000012 00000000603 11220734044 015633 0 ustar jcameron wheel start_cmd=/etc/init.d/mysql start stop_cmd=/etc/init.d/mysql stop mysql=/usr/bin/mysql mysqldump=/usr/bin/mysqldump mysqlimport=/usr/bin/mysqlimport mysql_libs= mysqladmin=/usr/bin/mysqladmin mysqlshow=/usr/bin/mysqlshow perpage=25 style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/var/lib/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/config-debian-linux 0000644 0005671 0000012 00000000614 11220734044 015446 0 ustar jcameron wheel start_cmd=(/usr/bin/safe_mysqld || /usr/bin/mysqld_safe) >/dev/null 2>&1 & mysql=/usr/bin/mysql mysqldump=/usr/bin/mysqldump mysqlimport=/usr/bin/mysqlimport mysql_libs= mysqladmin=/usr/bin/mysqladmin mysqlshow=/usr/bin/mysqlshow perpage=25 style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/var/lib/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/config.info.ja_JP.UTF-8 0000664 0005671 0000012 00000003321 11220734044 015607 0 ustar jcameron wheel line1=設定可能なオプション,11 login=管理ログイン,0 pass=管理パスワード,12 perpage=1ページに表示する列数,0 style=データベースとテーブルの表示,1,1-リスト,0-アイコン,2-名前のみ add_mode=垂直列編集インターフェイスを使用する,1,1-はい,0-いいえ blob_mode=BLOBとテキストフィールドの表示,1,0-テーブル内のデータ,1-ダウンロードリンク nodbi=可能であれば接続にDBIを使用しますか?,1,0-はい,1-いいえ date_subs=バックアップ先の strftime 置換をおこないますか?,1,1-はい,0-いいえ passwd_mode=パスワードハッシュモード,1,1-旧式,0-デフォルト encoding=データベース内容のエンコーディング,3,デフォルト (現在の言語設定) max_dbs=データベースとテーブルを表示する最大数,0,5 max_text=テキストフィールドの最大表示長,3,無制限 charset=MySQLデータのキャラクターセット,15,charset line2=システム設定,11 mysqlshow=mysqlshowコマンドへのパス,0 mysqladmin=mysqladminコマンドへのパス,0 mysql=mysqlコマンドへのパス,0 mysqldump=mysqldumpコマンドへのパス,0 mysqlimport=mysqlimportコマンドへのパス,0 mysqld=mysqldコマンドへのパス,3,自動 start_cmd=MySQLサーバの起動コマンド,0 stop_cmd=MySQLサーバの停止コマンド,3,自動 mysql_libs=MySQL共有ライブラリディレクトリへのパス,3,なし mysql_data=MySQLデータベースディレクトリへのパス,3,なし host=接続先のMySQLホスト,3,localhost port=MySQLの接続ポート,3,デフォルト sock=MySQLのソケットファイル,3,デフォルト my_cnf=MySQL設定ファイル,0 mysql/module.info 0000644 0005671 0000012 00000001725 11220734045 014050 0 ustar jcameron wheel category=servers risk=low medium high desc_ko_KR.euc=MySQL ͺ̽ desc_zh_TW.Big5=MySQL ƮwA desc_tr=MySQL Veritaban Sunucusu desc=MySQL Database Server desc_pl=Serwer baz danych MySQL desc_sv=MySQL-databasserver desc_de=MySQL Datenbank-Server desc_es=Servidor de Base de Datos MySQL name=MySQL desc_ja_JP.euc=MySQL ǡ١ desc_zh_CN=MySQL ݿ desc_pt=Servidor de base de dados MySQL desc_ca=Servidor de BD MySQL desc_hu=MySQL Adatbzis szerver desc_ru_SU= MySQL desc_ru_RU= MySQL longdesc=Setup databases, tables and permissions in your MySQL database server. readonly=1 syslog=1 desc_zh_TW.UTF-8=MySQL 資料庫伺服器 desc_zh_CN.UTF-8=MySQL 数据库服务器 desc_ja_JP.UTF-8=MySQL データベース サーバ cpan=1 desc_ko_KR.UTF-8=MySQL 데이터베이스 서버 desc_it=Server di database MySQL desc_cz=Databzov server MySQL desc_ru.UTF-8=Сервер баз данных MySQL version=1.481 mysql/delete_dbs.cgi 0000775 0005671 0000012 00000001245 11220734044 014465 0 ustar jcameron wheel #!/usr/local/bin/perl # Delete several selected users require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); &error_setup($text{'dbs_derr'}); @d = split(/\0/, $in{'d'}); @d || &error($trext{'dbs_enone'}); # Delete the users foreach $hdu (@d) { ($host, $db, $user) = split(/ /, $hdu); $access{'perms'} == 1 || &can_edit_db($db) || &error($text{'perms_edb'}); &execute_sql_logged($master_db, "delete from db where user = '$user' ". "and host = '$host' ". "and db = '$db'"); } &execute_sql_logged($master_db, 'flush privileges'); # Log it &webmin_log("delete", "dbprivs", scalar(@d)); &redirect("list_dbs.cgi"); mysql/save_user.cgi 0000755 0005671 0000012 00000005675 11220734044 014400 0 ustar jcameron wheel #!/usr/local/bin/perl # save_user.cgi # Save, create or delete a user require './mysql-lib.pl'; &ReadParse(); $access{'perms'} == 1 || &error($text{'perms_ecannot'}); if ($in{'delete'}) { # Delete some user &execute_sql_logged($master_db, "delete from user where user = '$in{'olduser'}' ". "and host = '$in{'oldhost'}'"); } else { # Validate inputs &error_setup($text{'user_err'}); $in{'mysqluser_def'} || $in{'mysqluser'} =~ /^\S+$/ || &error($text{'user_euser'}); $in{'host_def'} || $in{'host'} =~ /^\S+$/ || &error($text{'user_ehost'}); map { $perms[$_]++ } split(/\0/, $in{'perms'}); @desc = &table_structure($master_db, 'user'); $host = $in{'host_def'} ? '' : $in{'host'}; $user = $in{'mysqluser_def'} ? '' : $in{'mysqluser'}; if ($in{'new'}) { # Create a new user for($i=3; $i<=&user_priv_cols()+3-1; $i++) { push(@yesno, $perms[$i] ? "'Y'" : "'N'"); } $sql = sprintf "insert into user (%s) values ('%s', '%s', '', %s)", join(",", map { $desc[$_]->{'field'} } (0 .. &user_priv_cols()+3-1)), $host, $user, join(",", @yesno); } else { # Update existing user for($i=3; $i<=&user_priv_cols()+3-1; $i++) { push(@yesno, $desc[$i]->{'field'}."=". ($perms[$i] ? "'Y'" : "'N'")); } $sql = sprintf "update user set host = '%s', user = '%s', ". "%s where user = '%s' and host = '%s'", $host, $user, join(" , ", @yesno), $in{'olduser'}, $in{'oldhost'}; } &execute_sql_logged($master_db, $sql); if ($in{'mysqlpass_mode'} == 0) { $esc = &escapestr($in{'mysqlpass'}); &execute_sql_logged($master_db, "update user set password = $password_func('$esc') ". "where user = '$user' and host = '$host'"); } elsif ($in{'mysqlpass_mode'} == 2) { &execute_sql_logged($master_db, "update user set password = NULL ". "where user = '$user' and host = '$host'"); } } &execute_sql_logged($master_db, 'flush privileges'); if (!$in{'delete'} && !$in{'new'} && $in{'olduser'} eq $config{'login'} && !$access{'user'}) { # Renamed or changed the password for the Webmin login .. update # it too! $config{'login'} = $in{'mysqluser'}; if ($in{'mysqlpass_mode'} == 0) { $config{'pass'} = $in{'mysqlpass'}; } elsif ($in{'mysqlpass_mode'} == 2) { $config{'pass'} = undef; } &lock_file($module_config_file); &save_module_config(); &unlock_file($module_config_file); } if ($in{'delete'}) { &webmin_log("delete", "user", $in{'olduser'}, { 'user' => $in{'olduser'}, 'host' => $in{'oldhost'} } ); } elsif ($in{'new'}) { &webmin_log("create", "user", $in{'mysqluser_def'} ? '' : $in{'mysqluser'}, { 'user' => $in{'mysqluser_def'} ? '' : $in{'mysqluser'}, 'host' => $in{'host_def'} ? '' : $in{'host'} } ); } else { &webmin_log("modify", "user", $in{'mysqluser_def'} ? '' : $in{'mysqluser'}, { 'user' => $in{'mysqluser_def'} ? '' : $in{'mysqluser'}, 'host' => $in{'host_def'} ? '' : $in{'host'} } ); } &redirect("list_users.cgi"); mysql/save_host.cgi 0000755 0005671 0000012 00000004502 11220734044 014363 0 ustar jcameron wheel #!/usr/local/bin/perl # save_host.cgi # Save, create or delete a host table record require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'delete'}) { # Delete some host $access{'perms'} == 1 || &can_edit_db($in{'olddb'}) || &error($text{'perms_edb'}); &execute_sql_logged($master_db, "delete from host where host = '$in{'oldhost'}' ". "and db = '$in{'olddb'}'"); } else { # Validate inputs &error_setup($text{'host_err'}); $in{'host_def'} || $in{'host'} =~ /^\S+$/ || &error($text{'host_ehost'}); if ($access{'perms'} == 2 && $access{'dbs'} ne '*') { $db = $in{'dbs'}; } else { $db = $in{'db_def'} == 1 ? "" : $in{'db_def'} == 2 ? $in{'dbs'} : $in{'db'}; $db =~ /^\S*$/ || &error($text{'host_edb'}); } if ($access{'perms'} == 2) { $in{'new'} || &can_edit_db($in{'olddb'}) || &error($text{'perms_edb'}); &can_edit_db($db) || &error($text{'perms_edb'}); } map { $perms[$_]++ } split(/\0/, $in{'perms'}); @desc = &table_structure($master_db, 'host'); if ($in{'new'}) { # Create a new host for($i=2; $i<=&host_priv_cols()+2-1; $i++) { push(@yesno, $perms[$i] ? "'Y'" : "'N'"); } $sql = sprintf "insert into host (%s) values ('%s', '%s', %s)", join(",", map { $desc[$_]->{'field'} } (0 .. &host_priv_cols()+2-1)), $in{'host_def'} ? '' : $in{'host'}, $db, join(",", @yesno); } else { # Update existing host for($i=2; $i<=&host_priv_cols()+2-1; $i++) { push(@yesno, $desc[$i]->{'field'}."=". ($perms[$i] ? "'Y'" : "'N'")); } $sql = sprintf "update host set host = '%s', db = '%s', %s ". "where host = '%s' and db = '%s'", $in{'host_def'} ? '' : $in{'host'}, $db, join(" , ", @yesno), $in{'oldhost'}, $in{'olddb'}; } &execute_sql_logged($master_db, $sql); } &execute_sql_logged($master_db, 'flush privileges'); if ($in{'delete'}) { &webmin_log("delete", "host", $in{'oldhost'}, { 'db' => $in{'olddb'}, 'host' => $in{'oldhost'} } ); } elsif ($in{'new'}) { &webmin_log("create", "host", $in{'host_def'} ? '' : $in{'host'}, { 'db' => $db, 'host' => $in{'host_def'} ? '' : $in{'host'} } ); } else { &webmin_log("modify", "host", $in{'host_def'} ? '' : $in{'host'}, { 'db' => $db, 'host' => $in{'host_def'} ? '' : $in{'host'} } ); } &redirect("list_hosts.cgi"); mysql/backup_form.cgi 0000775 0005671 0000012 00000012653 11220734044 014670 0 ustar jcameron wheel #!/usr/local/bin/perl # backup_form.cgi # Display a form for backing up this database, or all databases require './mysql-lib.pl'; &ReadParse(); if ($in{'all'}) { @alldbs = &list_databases(); @dbs = grep { &can_edit_db($_) } @alldbs; @alldbs == @dbs || &error($text{'dbase_ecannot'}); } else { &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); } $access{'edonly'} && &error($text{'dbase_ecannot'}); $access{'buser'} || &error($text{'dbase_ecannot'}); &ui_print_header(undef, $in{'all'} ? $text{'backup_title2'} : $text{'backup_title'}, "", "backup_form"); if (!-x $config{'mysqldump'}) { print &text('backup_edump', "$config{'mysqldump'}", "../config.cgi?$module_name"),"
\n"; &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}); exit; } $cron = !$module_info{'usermin'} && $access{'buser'} eq 'root' && !$access{'user'} && &foreign_installed("cron"); if ($in{'all'}) { print "$text{'backup_desc3'}\n"; } else { print &text('backup_desc', "$in{'db'}"),"\n"; } if ($cron) { print "$text{'backup_desc2'}\n"; } print "
\n";
%c = $module_info{'usermin'} ? %userconfig : %config;
print &ui_form_start("backup_db.cgi", "post");
print &ui_hidden("db", $in{'db'});
print &ui_hidden("all", $in{'all'});
print &ui_hidden_table_start($text{'backup_header1'}, "width=100%", 2, "main",
1, [ "width=30%" ]);
# Destination file or directory
print &ui_table_row($in{'all'} ? $text{'backup_file2'}
: $text{'backup_file'},
&ui_textbox("file", $c{'backup_'.$in{'db'}}, 60)." ".
&file_chooser_button("file"));
# Create destination dir
if ($in{'all'}) {
print &ui_table_row($text{'backup_mkdir'},
&ui_yesno_radio("mkdir", int($c{'backup_mkdir_'.$in{'db'}})));
}
if (!$in{'all'}) {
# Show input to select tables
$t = $c{'backup_tables_'.$in{'db'}};
@tables = &list_tables($in{'db'});
print &ui_table_row($text{'backup_tables'},
&ui_radio("tables_def", $t ? 0 : 1,
[ [ 1, $text{'backup_alltables'} ],
[ 0, $text{'backup_seltables'} ] ])."
".
&ui_select("tables", [ split(/\s+/, $t) ],
[ sort @tables ], 5, 1));
}
print &ui_hidden_table_end("main");
print &ui_hidden_table_start($text{'backup_header2'}, "width=100%", 2, "opts",
0, [ "width=30%" ]);
# Show input for where clause
$w = $c{'backup_where_'.$in{'db'}};
print &ui_table_row($text{'backup_where'},
&ui_opt_textbox("where", $w, 30, $text{'backup_none'}));
# Show option to include drop statements in SQL
$d = $c{'backup_drop_'.$in{'db'}};
print &ui_table_row($text{'backup_drop'},
&ui_yesno_radio("drop", $d ? 1 : 0));
# Show input for character set
$s = $c{'backup_charset_'.$in{'db'}};
print &ui_table_row($text{'backup_charset'},
&ui_radio("charset_def", $s ? 0 : 1,
[ [ 1, $text{'default'} ],
[ 0, &ui_select("charset", $s,
[ &list_character_sets($in{'db'}) ]) ] ]));
if ($mysql_version >= 5.0) {
# Show compatability format option
$cf = $c{'backup_compatible_'.$in{'db'}};
print &ui_table_row($text{'backup_compatible'},
&ui_radio("compatible_def", $cf ? 0 : 1,
[ [ 1, $text{'default'} ],
[ 0, &text('backup_compwith',
&ui_select("compatible", $cf,
[ &list_compatible_formats() ])) ] ]));
%co = map { $_, 1 } split(/\s+/, $c{'backup_options_'.$in{'db'}});
$opts = "";
foreach $o (&list_compatible_options()) {
$opts .= &ui_checkbox("options", $o->[0], $o->[1] || $o->[0],
$co{$o->[0]})."
\n";
}
print &ui_table_row($text{'backup_options'}, $opts);
}
else {
print &ui_hidden("compatible_def", 1),"\n";
}
# Show compression option
$cp = int($c{'backup_compress_'.$in{'db'}});
print &ui_table_row($text{'backup_compress'},
&ui_radio("compress", $cp,
[ [ 0, $text{'backup_cnone'} ],
[ 1, $text{'backup_gzip'} ],
[ 2, $text{'backup_bzip2'} ] ]));
if ($cron) {
# Show before/after commands
$b = $c{'backup_before_'.$in{'db'}};
print &ui_table_row($text{'backup_before'},
&ui_textbox("before", $b, 60));
$a = $c{'backup_after_'.$in{'db'}};
print &ui_table_row($text{'backup_after'},
&ui_textbox("after", $a, 60));
if ($in{'all'}) {
# Command mode option
$cmode = $c{'backup_cmode_'.$in{'db'}};
print &ui_table_row($text{'backup_cmode'},
&ui_radio("cmode", int($cmode),
[ [ 0, $text{'backup_cmode0'} ],
[ 1, $text{'backup_cmode1'} ] ]));
}
print &ui_hidden_table_end("opts");
print &ui_hidden_table_start($text{'backup_header3'}, "width=100%", 2,
"sched", 1, [ "width=30%" ]);
# Show cron time
&foreign_require("cron", "cron-lib.pl");
@jobs = &cron::list_cron_jobs();
$cmd = $in{'all'} ? "$cron_cmd --all" : "$cron_cmd $in{'db'}";
($job) = grep { $_->{'command'} eq $cmd } @jobs;
print &ui_table_row($text{'backup_sched'},
&ui_radio("sched", $job ? 1 : 0,
[ [ 0, $text{'no'} ], [ 1, $text{'backup_sched1'} ] ]));
$job ||= { 'mins' => 0,
'hours' => 0,
'days' => '*',
'months' => '*',
'weekdays' => '*' };
print &ui_table_row(undef,
"
\n",
$in{'db'}, $in{'table'},
$in{'start'} - $displayconfig{'perpage'},
$searchargs, $sortargs;
}
print "",&text('view_pos', $in{'start'}+1,
$in{'start'}+$displayconfig{'perpage'} > $total ? $total :
$in{'start'}+$displayconfig{'perpage'}, $total),"\n";
if ($in{'start'}+$displayconfig{'perpage'} < $total) {
printf "".
"
",
$in{'db'}, $in{'table'},
$in{'start'} + $displayconfig{'perpage'},
$searchargs, $sortargs;
}
print "| ",&text('view_searchhead', "$in{'for'}", "$in{'field'}")," | \n"; print "$text{'view_searchreset'} |
| ",&text('view_searchhead2', $advcount)," | \n"; print "$text{'view_searchreset'} |
| ",&text($in{'sortdir'} ? 'view_sorthead2' : 'view_sorthead1', "$in{'sortfield'}")," | \n"; print "$text{'view_sortreset'} |
| $text{'view_field'} | ". "$text{'view_data'} |
| $str[$j]->{'field'} | \n"; if ($displayconfig{'blob_mode'} && &is_blob($str[$j]) && $d[$j]) { # Show as keep/upload inputs $et .= &ui_radio($nm."_def", 1, [ [ 1, $text{'view_keep'} ], [ 0, $text{'view_set'} ] ])." ". &ui_upload($nm); } elsif ($displayconfig{'blob_mode'} && &is_blob($str[$j])) { # Show upload input $et .= &ui_upload($nm); } elsif ($str[$j]->{'type'} =~ /^enum\((.*)\)$/) { # Show as enum list $et .= &ui_select($nm, $d[$j], [ [ "", " " ], map { [ $_ ] } &split_enum($1) ], 1, 0, 1); } elsif ($str[$j]->{'type'} =~ /\((\d+)\)/) { # Show as known-size text if ($1 > 255) { # Too big, use text area $et .= &ui_textarea( $nm, $d[$j], 5, 70); } else { # Text box local $nw = $1 > 70 ? 70 : $1; $et .= &ui_textbox( $nm, $d[$j], $nw); } } elsif (&is_blob($str[$j])) { # Show as multiline text $et .= &ui_textarea($nm, $d[$j], 5, 70); } else { # Show as fixed-size text $et .= &ui_textbox($nm, $d[$j], 30); } $et .= " |
\n"; } # Show buttons to edit / delete rows if (!$keyed) { print "$text{'view_nokey'}
\n"; print &ui_form_end(); } elsif (!$check) { if ($in{'new'}) { print &ui_form_end([ [ "savenew", $text{'save'} ], [ "cancel", $text{'cancel'} ] ]); } else { print &ui_form_end([ [ "save", $text{'save'} ], [ "cancel", $text{'cancel'} ] ]); } } elsif ($total) { print &ui_form_end([ [ "edit", $text{'view_edit'} ], [ "new", $text{'view_new'} ], [ "delete", $text{'view_delete'} ] ]); } else { print &ui_form_end([ [ "new", $text{'view_new'} ] ]); } if (!$in{'field'} && $total > $displayconfig{'perpage'}) { # Show search and jump buttons print &ui_hr(); print "
| ",&ui_submit($text{'table_add'}); print &ui_select("type", undef, \@type_list); print " | ",&ui_form_end(); # View and edit data button print &ui_form_start("view_table.cgi", "form-data"); print $hiddens; print "",&ui_submit($text{'table_data'}); print " | ",&ui_form_end(); # CSV export button print &ui_form_start("csv_form.cgi"); print $hiddens; print "",&ui_submit($text{'table_csv'}); print " | ",&ui_form_end(); if ($access{'indexes'}) { # Create index button print &ui_form_start("edit_index.cgi"); print $hiddens; print "",&ui_submit($text{'table_index'}); print " | ",&ui_form_end(); } # Drop table button print &ui_form_start("drop_table.cgi"); print $hiddens; print "",&ui_submit($text{'table_drop'}); print " | ",&ui_form_end(); print "