mysql/0000755000567100000120000000000011220734045011701 5ustar jcameronwheelmysql/config-sol-linux0000664000567100000120000000066311220734044015027 0ustar jcameronwheelstart_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.cgi0000775000567100000120000001422311220734044014305 0ustar jcameronwheel#!/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_UA0000664000567100000120000000154011220734044015027 0ustar jcameronwheelmysqlimport= 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.tr0000644000567100000120000000207311220734044014450 0ustar jcameronwheelline1=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/config0000644000567100000120000000076611220734044013101 0ustar jcameronwheelstart_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-linux0000664000567100000120000000061511220734044016166 0ustar jcameronwheelstart_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.pl0000775000567100000120000001065311220734044014735 0ustar jcameronwheel require 'mysql-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the mysql module sub acl_security_form { print " $text{'acl_dbs'}\n"; print "\n"; printf " %s\n", $_[0]->{'dbs'} eq '*' ? 'checked' : '', $text{'acl_dall'}; printf " %s
\n", $_[0]->{'dbs'} eq '*' ? '' : 'checked', $text{'acl_dsel'}; print "\n"; print "$text{'acl_delete'} \n"; printf " %s\n", $_[0]->{'delete'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'delete'} ? '' : 'checked', $text{'no'}; print " $text{'acl_stop'} \n"; printf " %s\n", $_[0]->{'stop'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'stop'} ? '' : 'checked', $text{'no'}; print " $text{'acl_edonly'} \n"; printf " %s\n", $_[0]->{'edonly'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'edonly'} ? '' : 'checked', $text{'no'}; print " $text{'acl_indexes'}\n"; print "",&ui_yesno_radio("indexes", $_[0]->{'indexes'}),"\n"; print "$text{'acl_views'}\n"; print "",&ui_yesno_radio("views", $_[0]->{'views'})," \n"; print " $text{'acl_create'} \n"; printf " %s\n", $_[0]->{'create'} == 1 ? 'checked' : '', $text{'yes'}; printf " %s\n", $_[0]->{'create'} == 2 ? 'checked' : '', $text{'acl_max'}; printf "\n", $_[0]->{'max'}; printf " %s \n", $_[0]->{'create'} == 0 ? 'checked' : '', $text{'no'}; print " $text{'acl_perms'} \n"; printf " %s\n", $_[0]->{'perms'} == 1 ? 'checked' : '', $text{'yes'}; printf " %s\n", $_[0]->{'perms'} == 2 ? 'checked' : '', $text{'acl_only'}; printf " %s\n", $_[0]->{'perms'} == 0 ? 'checked' : '', $text{'no'}; print " \n"; print " $text{'acl_login'} \n"; printf " %s
\n", $_[0]->{'user'} ? '' : 'checked', $text{'acl_user_def'}; printf "\n", $_[0]->{'user'} ? 'checked' : ''; printf "%s \n", $text{'acl_user'}, $_[0]->{'user'}; printf "%s \n", $text{'acl_pass'}, $_[0]->{'pass'}; print " $text{'acl_buser'}\n"; printf " %s\n", $_[0]->{'buser'} ? "" : "checked", $text{'acl_bnone'}; printf "\n", $_[0]->{'buser'} ? "checked" : ""; printf " %s \n", $_[0]->{'buser'}, &user_chooser_button("buser"); print " $text{'acl_bpath'}\n"; printf " %s \n", $_[0]->{'bpath'}, &file_chooser_button("bpath", 1); } # acl_security_save(&options) # Parse the form for security options for the mysql module sub acl_security_save { if ($in{'dbs_def'}) { $_[0]->{'dbs'} = '*'; } else { $_[0]->{'dbs'} = join(" ", split(/\0/, $in{'dbs'})); } $_[0]->{'create'} = $in{'create'}; $_[0]->{'indexes'} = $in{'indexes'}; $_[0]->{'views'} = $in{'views'}; $_[0]->{'max'} = $in{'max'}; $_[0]->{'delete'} = $in{'delete'}; $_[0]->{'bpath'} = $in{'bpath'}; $_[0]->{'buser'} = $in{'buser_def'} ? undef : $in{'buser'}; $_[0]->{'stop'} = $in{'stop'}; $_[0]->{'perms'} = $in{'perms'}; $_[0]->{'edonly'} = $in{'edonly'}; if ($in{'user_def'}) { delete($_[0]->{'user'}); delete($_[0]->{'pass'}); } else { $_[0]->{'user'} = $in{'user'}; $_[0]->{'pass'} = $in{'pass'}; } } mysql/edit_host.cgi0000755000567100000120000000264111220734044014354 0ustar jcameronwheel#!/usr/local/bin/perl # edit_host.cgi # Edit or create a host table record require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'new'}) { &ui_print_header(undef, $text{'host_title1'}, ""); } else { $d = &execute_sql_safe($master_db, "select * from host order by host"); $u = $d->{'data'}->[$in{'idx'}]; $access{'perms'} == 1 || &can_edit_db($u->[1]) || &error($text{'perms_edb'}); &ui_print_header(undef, $text{'host_title2'}, ""); } print &ui_form_start("save_host.cgi"); if ($in{'new'}) { print &ui_hidden("new", 1); } else { print &ui_hidden("oldhost", $u->[0]); print &ui_hidden("olddb", $u->[1]); } print &ui_table_start($text{'host_header'}, undef, 2); # Database name print &ui_table_row($text{'host_db'}, &select_db($u->[1])); # Hostname pattern print &ui_table_row($text{'host_host'}, &ui_opt_textbox("host", $u->[0] eq '%' ? '' : $u->[0], 40, $text{'host_any'})); # Host's permissions for($i=2; $i<=&host_priv_cols()+2-1; $i++) { push(@opts, [ $i, $text{"host_priv$i"} ]); push(@sel, $i) if ($u->[$i] eq 'Y'); } print &ui_table_row($text{'host_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_hosts.cgi', $text{'hosts_return'}, "", $text{'index_return'}); mysql/view-lib.pl0000775000567100000120000000523511220734044013765 0ustar jcameronwheel# Functions used by view_table.cgi and siblings # get_search_args(&in) # Returns the search SQL, search URL arguments and search hidden fields sub get_search_args { local %in = %{$_[0]}; local ($search, $searchhids, $searchargs, @adv); if ($in{'field'}) { # A simple search $search = "where "."estr($in{'field'})." ". &make_like($in{'match'}, $in{'for'}); $searchargs = "&field=".&urlize($in{'field'}). "&for=".&urlize($in{'for'}). "&match=".&urlize($in{'match'}); $searchhids = &ui_hidden("field", $in{'field'})."\n". &ui_hidden("for", $in{'for'})."\n". &ui_hidden("match", $in{'match'})."\n"; } elsif ($in{'advanced'}) { # An advanced search for(my $i=0; defined($in{"field_$i"}); $i++) { if ($in{"field_$i"}) { push(@adv, "estr($in{"field_$i"})." ". &make_like($in{"match_$i"}, $in{"for_$i"})); $searchargs .= "&field_$i=".&urlize($in{"field_$i"}). "&for_$i=".&urlize($in{"for_$i"}). "&match_$i=".&urlize($in{"match_$i"}); $searchhids .= &ui_hidden("field_$i", $in{"field_$i"})."\n". &ui_hidden("for_$i", $in{"for_$i"})."\n". &ui_hidden("match_$i", $in{"match_$i"})."\n"; } } if (@adv) { $search = "where (".join($in{'and'} ? " and " : " or ", @adv).")"; $searchhids .= &ui_hidden("and", $in{'and'})."\n". &ui_hidden("advanced", 1)."\n"; $searchargs .= "&and=".$in{'and'}. "&advanced=1"; } } return ($search, $searchhids, $searchargs, scalar(@adv)); } # get_search_limit(&in) # Build limiting expression sub get_search_limit { local %in = %{$_[0]}; $in{'start'} ||= 0; if ($module_name eq "mysql") { return "limit $in{'start'},$displayconfig{'perpage'}"; } else { return "limit $displayconfig{'perpage'} offset $in{'start'}"; } } # get_search_limit(&in) # Returns an SQL expression for sorting, hidden fields for the current sort order, and # URL args for the current order sub get_search_sort { local %in = %{$_[0]}; if ($in{'sortfield'}) { local ($sort, $sorthids, $sortargs); $sort = "order by "."estr($in{'sortfield'})." ".($in{'sortdir'} ? "asc" : "desc"); $sorthids = &ui_hidden("sortfield", $in{'sortfield'})."\n". &ui_hidden("sortdir", $in{'sortdir'})."\n"; $sortargs = "&sortfield=".&urlize($in{'sortfield'}). "&sortdir=$in{'sortdir'}"; return ($sort, $sorthids, $sortargs); } else { return ( undef, undef, undef ); } } # make_like(mode, for) sub make_like { local ($match, $for) = @_; local $qu = $module_name eq "mysql" ? '"' : "'"; return $match == 0 ? "like $qu%$for%$qu" : $match == 1 ? "like $qu$for$qu" : $match == 2 ? "not like $qu%$for%$qu" : $match == 3 ? "not like $qu$for$qu" : " = \"\""; } 1; mysql/save_root.cgi0000775000567100000120000000141611220734044014374 0ustar jcameronwheel#!/usr/local/bin/perl # Update the password for root, both in MySQL and Webmin require './mysql-lib.pl'; &ReadParse(); &error_setup($text{'root_err'}); $access{'perms'} == 1 || &error($text{'perms_ecannot'}); # Validate inputs $in{'newpass1'} || &error($text{'root_epass1'}); $in{'newpass1'} eq $in{'newpass2'} || &error($text{'root_epass2'}); # Update MySQL $esc = &escapestr($in{'newpass1'}); $user = $mysql_login || "root"; &execute_sql_logged($master_db, "update user set password = $password_func('$esc') ". "where user = '$user'"); &execute_sql_logged($master_db, 'flush privileges'); # Update webmin $config{'pass'} = $in{'newpass1'}; &lock_file($module_config_file); &save_module_config(); &unlock_file($module_config_file); &webmin_log("root"); &redirect(""); mysql/config-mandrake-linux0000644000567100000120000000061511220734044016007 0ustar jcameronwheelstart_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/useradmin_update.pl0000775000567100000120000000552311220734044015600 0ustar jcameronwheel $use_global_login = 1; # Always login as master user, not the mysql # login of the current Webmin user do 'mysql-lib.pl'; # useradmin_create_user(&details) # Create a new mysql user if syncing is enabled sub useradmin_create_user { if ($config{'sync_create'}) { local %privs; map { $privs{$_}++ } split(/\s+/, $config{'sync_privs'}); for($i=3; $i<=&user_priv_cols()+3-1; $i++) { push(@yesno, $privs{$i} ? "'Y'" : "'N'"); } @desc = &table_structure($master_db, 'user'); local $sql = sprintf "insert into user (%s) values ('%s', '%s', %s, %s)", join(",", map { $desc[$_]->{'field'} } (0 .. &user_priv_cols()+3-1)), $config{'sync_host'}, $_[0]->{'user'}, $_[0]->{'passmode'} == 3 ? "$password_func('$_[0]->{'plainpass'}')" : $_[0]->{'passmode'} == 0 ? "''" : "'*'", join(",", @yesno); &execute_sql_logged($master_db, $sql); &execute_sql_logged($master_db, 'flush privileges'); } } # useradmin_delete_user(&details) # Delete a mysql user sub useradmin_delete_user { if ($config{'sync_delete'}) { &execute_sql_logged($master_db, "delete from user where user = '$_[0]->{'user'}'"); &execute_sql_logged($master_db, "delete from db where user = '$_[0]->{'user'}'"); &execute_sql_logged($master_db, "delete from tables_priv where user = '$_[0]->{'user'}'"); &execute_sql_logged($master_db, "delete from columns_priv where user = '$_[0]->{'user'}'"); &execute_sql_logged($master_db, 'flush privileges'); } } # useradmin_modify_user(&details) # Update a mysql user sub useradmin_modify_user { if ($config{'sync_modify'}) { local $sql; $_[0]->{'olduser'} ||= $_[0]->{'user'}; # In case not changed if ($_[0]->{'passmode'} == 4) { # Not changing password $sql = sprintf "update user set user = '%s' where user = '%s'", $_[0]->{'user'}, $_[0]->{'olduser'}; } elsif ($_[0]->{'passmode'} == 3) { # Setting new password $sql = sprintf "update user set user = '%s', password = $password_func('%s') where user = '%s'", $_[0]->{'user'}, $_[0]->{'plainpass'}, $_[0]->{'olduser'}; } elsif ($_[0]->{'passmode'} == 0) { # No password $sql = sprintf "update user set user = '%s', password = '' where user = '%s'", $_[0]->{'user'}, $_[0]->{'olduser'}; } else { # Assume locked $sql = sprintf "update user set user = '%s', password = '*' where user = '%s'", $_[0]->{'user'}, $_[0]->{'olduser'}; } &execute_sql_logged($master_db, $sql); if ($_[0]->{'user'} ne $_[0]->{'olduser'}) { &execute_sql_logged($master_db, "update db set user = '$_[0]->{'user'}' ". "where user = '$_[0]->{'olduser'}'"); &execute_sql_logged($master_db, "update tables_priv set user = '$_[0]->{'user'}' ". "where user = '$_[0]->{'olduser'}'"); &execute_sql_logged($master_db, "update columns_priv set user = '$_[0]->{'user'}' ". "where user = '$_[0]->{'olduser'}'"); } &execute_sql_logged($master_db, 'flush privileges'); } } 1; mysql/log_parser.pl0000775000567100000120000000602211220734044014377 0ustar jcameronwheel# log_parser.pl # Functions for parsing this module's logs do 'mysql-lib.pl'; # parse_webmin_log(user, script, action, type, object, ¶ms) # Converts logged information from this module into human-readable form sub parse_webmin_log { local ($user, $script, $action, $type, $object, $p, $long) = @_; if ($action eq 'stop') { return $text{'log_stop'}; } elsif ($action eq 'start') { return $text{'log_start'}; } elsif ($action eq 'cnf') { return $text{'log_cnf'}; } elsif ($action eq 'kill') { return &text('log_kill', $object); } elsif ($action eq 'vars') { return &text('log_vars', $object); } elsif ($type eq 'db') { return &text("log_${type}_${action}", "$object"); } elsif ($type eq 'dbs' || $type eq 'users' || $type eq 'hosts' || $type eq 'cprivs' || $type eq 'tprivs' || $type eq 'dbprivs') { return &text("log_${type}_${action}", $object); } elsif ($type eq 'table' || $type eq 'index' || $type eq 'view') { return &text("log_${type}_${action}", "$object", "$p->{'db'}"); } elsif ($type eq 'tables') { return &text("log_${type}_${action}", $object, "$p->{'db'}"); } elsif ($type eq 'field') { $p->{'size'} =~ s/\s+$//; return &text("log_${type}_${action}", "$object", "$p->{'table'}", "$p->{'db'}", "$p->{'type'}$p->{'size'}"); } elsif ($type eq 'fields') { return &text("log_${type}_${action}", $object, "$p->{'table'}", "$p->{'db'}"); } elsif ($type eq 'data') { return &text("log_${type}_${action}", "$object", "$p->{'table'}", "$p->{'db'}"); } elsif ($action eq 'exec') { return &text($long ? 'log_exec_l' : 'log_exec', "$object", "".&html_escape($p->{'cmd'}).""); } elsif ($type eq 'user' || $type eq 'perm' || $type eq 'host' || $type eq 'tpriv' || $type eq 'cpriv') { $p->{'user'} = $text{'log_anon'} if ($p->{'user'} eq '-' || $p->{'user'} eq '%'); $p->{'db'} = $text{'log_any'} if ($p->{'db'} eq '-' || $p->{'db'} eq '%'); $p->{'host'} = $text{'log_any'} if ($p->{'host'} eq '-' || $p->{'host'} eq '%'); local $t = "log_${type}_${action}"; if ($long && $text{$t.'_l'}) { $t .= '_l'; } return &text($t, "$p->{'user'}", "$p->{'host'}", "$p->{'db'}", "$p->{'table'}", "$p->{'field'}"); } elsif ($action eq 'backup') { return &text($object ? ($long ? 'log_backup_l' : 'log_backup') : ($long ? 'log_backup_all_l' : 'log_backup_all'), "$object", "".&html_escape($p->{'file'}).""); } elsif ($action eq 'execfile') { return &text($p->{'mode'} ? 'log_execupload' : 'log_execfile', "".&html_escape($p->{'file'}).""); } elsif ($action eq 'import') { return &text($p->{'mode'} ? 'log_importupload' : 'log_importfile', "".&html_escape($p->{'file'}).""); } elsif ($action eq 'set') { return &text('log_set', $object); } elsif ($action eq 'root') { return $text{'log_root'}; } else { return undef; } } mysql/list_procs.cgi0000775000567100000120000000270011220734044014551 0ustar jcameronwheel#!/usr/local/bin/perl # Show currently connected MySQL users require './mysql-lib.pl'; $access{'perms'} == 1 || &error($text{'procs_ecannot'}); &ui_print_header(undef, $text{'procs_title'}, "", "procs"); # Get the processes, except this one $d = &execute_sql($master_db, "show full processlist"); @procs = grep { $_->[7] ne "show full processlist" || $_->[3] ne $master_db || $_->[1] ne $mysql_login } @{$d->{'data'}}; if (@procs) { print &ui_form_start("kill_procs.cgi", "post"); @tds = ( "width=5" ); @rowlinks = ( &select_all_link("d"), &select_invert_link("d") ); print &ui_links_row(\@rowlinks); print &ui_columns_start([ "", $text{'procs_id'}, $text{'procs_user'}, $text{'procs_host'}, $text{'procs_db'}, $text{'procs_cmd'}, $text{'procs_time'}, $text{'procs_query'} ], 100, 0, \@tds); foreach $r (@procs) { print &ui_checked_columns_row([ $r->[0], "$r->[1]", $r->[2], "$r->[3]", $r->[4], &nice_time($r->[5]), &html_escape($r->[7]) ], \@tds, "d", $r->[0]); } print &ui_columns_end(); print &ui_links_row(\@rowlinks); print &ui_form_end([ [ "kill", $text{'procs_kill'} ] ]); } else { print "$text{'procs_none'}

\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.cgi0000755000567100000120000000375011220734044014357 0ustar jcameronwheel#!/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.pl0000775000567100000120000000107711220734044014527 0ustar jcameronwheel 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-linux0000644000567100000120000000060511220734044015203 0ustar jcameronwheelstart_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-*0000644000567100000120000000065511220734044016637 0ustar jcameronwheelmysqlimport=/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-freebsd0000644000567100000120000000071311220734044014501 0ustar jcameronwheelstart_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.Big50000644000567100000120000000132211220734044015637 0ustar jcameronwheelline1=պAﶵ,11 login=Ʈw޲z̦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.cgi0000775000567100000120000000326511220734044014405 0ustar jcameronwheel#!/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_RU0000664000567100000120000000147311220734044015064 0ustar jcameronwheelmysqlimport= 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.cgi0000775000567100000120000000142611220734044014402 0ustar jcameronwheel#!/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-linux0000644000567100000120000000061511220734044015166 0ustar jcameronwheelstart_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.cgi0000755000567100000120000000324511220734044013765 0ustar jcameronwheel#!/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-*0000644000567100000120000000060311220734044015633 0ustar jcameronwheelstart_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-linux0000644000567100000120000000061411220734044015446 0ustar jcameronwheelstart_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-80000664000567100000120000000332111220734044015607 0ustar jcameronwheelline1=設定可能なオプション,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.info0000644000567100000120000000172511220734045014050 0ustar jcameronwheelcategory=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.cgi0000775000567100000120000000124511220734044014465 0ustar jcameronwheel#!/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.cgi0000755000567100000120000000567511220734044014400 0ustar jcameronwheel#!/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.cgi0000755000567100000120000000450211220734044014363 0ustar jcameronwheel#!/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.cgi0000775000567100000120000001265311220734044014670 0ustar jcameronwheel#!/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, "". &capture_function_output(\&cron::show_times_input, $job). "
", 2); print &ui_hidden_table_end("sched"); } else { print &ui_hidden_table_end("opts"); } if ($cron) { print &ui_form_end([ [ "backup", $text{'backup_ok'} ], [ "save", $text{'backup_ok2'} ] ]); } else { print &ui_form_end([ [ "backup", $text{'backup_ok'} ] ]); } 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/save_tpriv.cgi0000755000567100000120000000506611220734044014560 0ustar jcameronwheel#!/usr/local/bin/perl # save_tpriv.cgi # Save, update or delete table permissions require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'delete'}) { # Delete some permissions $access{'perms'} == 1 || &can_edit_db($in{'olddb'}) || &error($text{'perms_edb'}); &execute_sql_logged($master_db, "delete from tables_priv where user = '$in{'olduser'}' ". "and host = '$in{'oldhost'}' and db = '$in{'olddb'}' ". "and table_name = '$in{'oldtable'}'"); } else { # Validate inputs &error_setup($text{'tpriv_err'}); $in{'table'} || &error($text{'tpriv_etable'}); $in{'user_def'} || $in{'user'} =~ /^\S+$/ || &error($text{'tpriv_euser'}); $in{'host_def'} || $in{'host'} =~ /^\S+$/ || &error($text{'tpriv_ehost'}); $in{'perms1'} =~ s/\0/,/g; $in{'perms2'} =~ s/\0/,/g; if ($in{'db'}) { # Create new table permissions $access{'perms'} == 1 || &can_edit_db($in{'db'}) || &error($text{'perms_edb'}); $sql = sprintf "insert into tables_priv values ('%s', '%s', ". "'%s', '%s', '%s', NULL, '%s', '%s')", $in{'host_def'} ? '%' : $in{'host'}, $in{'db'}, $in{'user_def'} ? '' : $in{'user'}, $in{'table'}, $config{'login'}, $in{'perms1'}, $in{'perms2'}; } else { # Update existing table permissions $access{'perms'} == 1 || &can_edit_db($in{'olddb'}) || &error($text{'perms_edb'}); $sql = sprintf "update tables_priv set host = '%s', ". "user = '%s', table_name = '%s', ". "table_priv = '%s', column_priv = '%s' where ". "host = '%s' and db = '%s' and user = '%s' ". "and table_name = '%s'", $in{'host_def'} ? '%' : $in{'host'}, $in{'user_def'} ? '' : $in{'user'}, $in{'table'}, $in{'perms1'}, $in{'perms2'}, $in{'oldhost'}, $in{'olddb'}, $in{'olduser'}, $in{'oldtable'}; } &execute_sql_logged($master_db, $sql); } &execute_sql_logged($master_db, 'flush privileges'); if ($in{'delete'}) { &webmin_log("delete", "tpriv", $in{'oldtable'}, { 'user' => $in{'olduser'}, 'host' => $in{'oldhost'}, 'db' => $in{'olddb'}, 'table' => $in{'oldtable'} } ); } elsif ($in{'db'}) { &webmin_log("create", "tpriv", $in{'table'}, { 'user' => $in{'user_def'} ? '' : $in{'user'}, 'host' => $in{'host_def'} ? '%' : $in{'host'}, 'db' => $in{'db'}, 'table' => $in{'table'} } ); } else { &webmin_log("modify", "tpriv", $in{'table'}, { 'user' => $in{'user_def'} ? '' : $in{'user'}, 'host' => $in{'host_def'} ? '%' : $in{'host'}, 'db' => $in{'db'}, 'table' => $in{'table'} } ); } &redirect("list_tprivs.cgi"); mysql/view_table.cgi0000775000567100000120000003447311220734044014525 0ustar jcameronwheel#!/usr/local/bin/perl # view_table.cgi # Display all data in some table if (-r 'mysql-lib.pl') { require './mysql-lib.pl'; } else { require './postgresql-lib.pl'; } require './view-lib.pl'; if ($config{'charset'}) { $main::force_charset = $config{'charset'}; } if ($ENV{'CONTENT_TYPE'} !~ /boundary=/) { &ReadParse(); } else { &ReadParseMime(); } &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); @str = &table_structure($in{'db'}, $in{'table'}); foreach $s (@str) { $keyed++ if ($s->{'key'} eq 'PRI'); } if (!$keyed && $module_name eq "postgresql") { # Can use oid as key eval { $main::error_must_die = 1; $d = &execute_sql($in{'db'}, "select oid from ". "e_table($in{'table'}). " where 0 = 1"); }; if (!$@) { # Has an OID, so use it $use_oids = 1; $keyed = 1; } } # Get search SQL ($search, $searchhids, $searchargs, $advcount) = &get_search_args(\%in); # Work out start position $d = &execute_sql_safe($in{'db'}, "select count(*) from "."e_table($in{'table'})." ".$search); $total = int($d->{'data'}->[0]->[0]); if ($in{'jump'} > 0) { $in{'start'} = int($in{'jump'} / $displayconfig{'perpage'}) * $displayconfig{'perpage'}; if ($in{'start'} >= $total) { $in{'start'} = $total - $displayconfig{'perpage'}; $in{'start'} = int(($in{'start'} / $displayconfig{'perpage'}) + 1) * $displayconfig{'perpage'}; } } else { $in{'start'} = int($in{'start'}); } if ($in{'new'} && $total > $displayconfig{'perpage'}) { # go to the last screen for adding a row $in{'start'} = $total - $displayconfig{'perpage'}; $in{'start'} = int(($in{'start'} / $displayconfig{'perpage'}) + 1) * $displayconfig{'perpage'}; } # Get limiting and sorting SQL $limitsql = &get_search_limit(\%in); ($sortsql, $sorthids, $sortargs) = &get_search_sort(\%in); # Work out where clause for rows we are operating on $where_select = "select ".($use_oids ? "oid" : "*"). " from "."e_table($in{'table'})." $search $sortsql $limitsql"; if ($in{'delete'}) { # Deleting selected rows $d = &execute_sql($in{'db'}, $where_select); @t = map { $_->{'field'} } @str; $count = 0; foreach $r (split(/\0/, $in{'row'})) { local @where; local @r = @{$d->{'data'}->[$r]}; if ($use_oids) { # Where clause just uses OID push(@where, "oid = $r[0]"); } else { # Where clause uses keys for($i=0; $i<@t; $i++) { if ($str[$i]->{'key'} eq 'PRI') { if ($r[$i] eq 'NULL') { push(@where, "estr($t[$i]). " is null"); } else { $r[$i] =~ s/'/''/g; push(@where, "estr($t[$i]). " = '$r[$i]'"); } } } } &execute_sql_logged($in{'db'}, "delete from "."e_table($in{'table'}). " where ".join(" and ", @where)); $count++; } &webmin_log("delete", "data", $count, \%in); &redirect("view_table.cgi?db=$in{'db'}&". "table=".&urlize($in{'table'})."&start=$in{'start'}". $searchargs.$sortargs); } elsif ($in{'save'}) { # Update edited rows $d = &execute_sql($in{'db'}, $where_select); @t = map { $_->{'field'} } @str; $count = 0; for($j=0; $j<$displayconfig{'perpage'}; $j++) { next if (!defined($in{"${j}_$t[0]"})); local (@where, @set); local @r = @{$d->{'data'}->[$j]}; local @params; if ($use_oids) { # Where clause just uses OID push(@where, "oid = $r[0]"); } for($i=0; $i<@t; $i++) { if (!$use_oids) { # Where clause uses keys if ($str[$i]->{'key'} eq 'PRI') { if ($r[$i] eq 'NULL') { push(@where, "estr($t[$i]). " is null"); } else { $r[$i] =~ s/'/''/g; push(@where, "estr($t[$i]). " = '$r[$i]'"); } } } local $ij = $in{"${j}_$t[$i]"}; local $ijdef = $in{"${j}_$t[$i]_def"}; next if ($ijdef || !defined($ij)); if (!$displayconfig{'blob_mode'} || !&is_blob($str[$i])) { $ij =~ s/\r//g; } push(@set, "estr($t[$i])." = ?"); push(@params, $ij eq '' ? undef : $ij); } &execute_sql_logged($in{'db'}, "update "."e_table($in{'table'})." set ". join(" , ", @set)." where ". join(" and ", @where), @params); $count++; } &webmin_log("modify", "data", $count, \%in); &redirect("view_table.cgi?db=$in{'db'}&". "table=".&urlize($in{'table'})."&start=$in{'start'}". $searchargs.$sortargs); } elsif ($in{'savenew'}) { # Adding a new row for($j=0; $j<@str; $j++) { if (!$displayconfig{'blob_mode'} || !&is_blob($str[$j])) { $in{$j} =~ s/\r//g; } push(@set, $in{$j} eq '' ? undef : $in{$j}); } &execute_sql_logged($in{'db'}, "insert into "."e_table($in{'table'}). " values (".join(" , ", map { "?" } @set).")", @set); &redirect("view_table.cgi?db=$in{'db'}&". "table=".&urlize($in{'table'})."&start=$in{'start'}". $searchargs.$sortargs); &webmin_log("create", "data", undef, \%in); } elsif ($in{'cancel'} || $in{'new'}) { undef($in{'row'}); } $desc = &text('table_header', "$in{'table'}", "$in{'db'}"); &ui_print_header($desc, $text{'view_title'}, ""); if ($in{'start'} || $total > $displayconfig{'perpage'}) { print "

\n"; if ($in{'start'}) { printf "". "\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 "
\n"; } print "\n"; if ($in{'field'}) { # Show details of simple search print "\n"; print "\n"; } elsif ($in{'advanced'}) { # Show details of advanced search print "\n"; print "\n"; } if ($in{'sortfield'}) { # Show current sort order print "\n"; print "\n"; } print "
",&text('view_searchhead', "$in{'for'}", "$in{'field'}"),"$text{'view_searchreset'}
",&text('view_searchhead2', $advcount),"$text{'view_searchreset'}
",&text($in{'sortdir'} ? 'view_sorthead2' : 'view_sorthead1', "$in{'sortfield'}"),"$text{'view_sortreset'}
\n"; if ($displayconfig{'blob_mode'}) { print &ui_form_start("view_table.cgi", "form-data"); } else { print &ui_form_start("view_table.cgi", "post"); } print &ui_hidden("db", $in{'db'}),"\n"; print &ui_hidden("table", $in{'table'}),"\n"; print &ui_hidden("start", $in{'start'}),"\n"; print $searchhids; print $sorthids; $check = !defined($in{'row'}) && !$in{'new'} && $keyed; if ($total || $in{'new'}) { # Get the rows of data, and show the table header $d = &execute_sql_safe($in{'db'}, "select * from "."e_table($in{'table'})." $search $sortsql $limitsql"); @data = @{$d->{'data'}}; @tds = $check ? ( "width=5" ) : ( ); ($has_blob) = grep { &is_blob($_) } @str; @rowlinks = $check ? ( &select_all_link("row"), &select_invert_link("row") ) : ( ); print &ui_links_row(\@rowlinks); print &ui_columns_start([ $check ? ( "" ) : ( ), map { &column_sort_link($_->{'field'}) } @str ], 100, 0, \@tds); # Add an empty row for inserting $realrows = scalar(@data); if ($in{'new'}) { push(@data, [ map { undef } @str ]); $row{$realrows} = 1; } # Show the rows, some of which may be editable map { $row{$_}++ } split(/\0/, $in{'row'}); $w = int(100 / scalar(@str)); $w = 10 if ($w < 10); for($i=0; $i<@data; $i++) { local @d = map { $_ eq "NULL" ? undef : $_ } @{$data[$i]}; if ($row{$i} && ($displayconfig{'add_mode'} || $has_blob)) { # Show multi-line row editor $et = "\n"; $et .= " ". "\n"; for($j=0; $j<@str; $j++) { local $nm = $i == $realrows ? $j : "${i}_$str[$j]->{'field'}"; $et .= "\n"; } $et .= "
$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 .= "
"; print &ui_columns_row([ $check ? ( "" ) : ( ), $et ], [ @tds, "colspan=".scalar(@d) ] ); } elsif ($row{$i}) { # Show one-line row-editor local @cols; for($j=0; $j<@d; $j++) { local $l = $d[$j] =~ tr/\n/\n/; local $nm = $i == $realrows ? $j : "${i}_$d->{'titles'}->[$j]"; if ($displayconfig{'blob_mode'} && &is_blob($str[$j])) { # Cannot edit this blob push(@cols, undef); } elsif ($str[$j]->{'type'} =~ /^enum\((.*)\)$/) { # Show as enum list push(@cols, &ui_select($nm, $d[$j], [ [ "", " " ], map { [ $_ ] } &split_enum($1) ], 1, 0, 1)); } elsif ($str[$j]->{'type'} =~ /\((\d+)\)/) { # Show as known-size text local $nw = $1 > 70 ? 70 : $1; push(@cols, &ui_textbox($nm, $d[$j], $nw)); } elsif ($l) { # Show as multiline text $l++; push(@cols, &ui_textarea($nm, $d[$j], $l, $w)); } else { # Show as known size text push(@cols, &ui_textbox($nm, $d[$j], $w)); } } print &ui_columns_row([ $check ? ( "" ) : ( ), @cols ], \@tds); } else { # Show row contents local @cols; local $j = 0; foreach $c (@d) { if ($displayconfig{'blob_mode'} && &is_blob($str[$j]) && $c ne '') { # Show download link for blob push(@cols, "$text{'view_download'}"); } else { # Just show text (up to limit) if ($config{'max_text'} && length($c) > $config{'max_text'}) { $c = substr($c, 0, $config{'max_text'})." ..."; } push(@cols, &html_escape($c)); } $j++; } if ($check) { print &ui_checked_columns_row(\@cols, \@tds, "row", $i); } else { print &ui_columns_row(\@cols, \@tds); } } } print &ui_columns_end(); print &ui_links_row(\@rowlinks); } else { print "$text{'view_none'}

\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 "\n"; print "\n"; print "\n"; print &ui_hidden("db", $in{'db'}); print &ui_hidden("table", $in{'table'}); $sel = &ui_select("field", undef, [ map { [ $_->{'field'}, $_->{'field'} ] } @str ]); $match = &ui_select("match", 0, [ map { [ $_, $text{'view_match'.$_} ] } (0.. 3) ]); print "\n"; print "\n"; print "\n"; print &ui_hidden("db", $in{'db'}); print &ui_hidden("table", $in{'table'}); print "\n"; print "\n"; print "\n"; print &ui_hidden("db", $in{'db'}); print &ui_hidden("table", $in{'table'}); print "\n"; print "\n"; print "
",&text('view_search2', "", $sel, $match); print "  ", "
"; print "
\n"; } if ($access{'edonly'}) { &ui_print_footer("edit_dbase.cgi?db=$in{'db'}",$text{'dbase_return'}, "", $text{'index_return'}); } else { &ui_print_footer("edit_table.cgi?db=$in{'db'}&table=". &urlize($in{'table'}), $text{'table_return'}, "edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); } # column_sort_link(name) # Returns HTML for a link to switch sorting mode sub column_sort_link { local ($field) = @_; local $dir = $in{'sortfield'} eq $field ? !$in{'sortdir'} : 0; local $img = $in{'sortfield'} eq $field && $dir ? "sortascgrey.gif" : $in{'sortfield'} eq $field && !$dir ? "sortdescgrey.gif" : $dir ? "sortasc.gif" : "sortdesc.gif"; return "". "$field"; } mysql/config-debian-linux-2.2-*0000644000567100000120000000067711220734044016105 0ustar jcameronwheelstart_cmd=/etc/init.d/mysql start >/dev/null 2>&1 & stop_cmd=/etc/init.d/mysql stop >/dev/null 2>&1 mysql=/usr/bin/mysql mysqldump=/usr/bin/mysqldump mysqlimport=/usr/bin/mysqlimport mysql_libs=/usr/local/mysql/lib 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/mysql/my.cnf max_text=1000 nopwd=0 mysql/save_vars.cgi0000775000567100000120000000136711220734044014371 0ustar jcameronwheel#!/usr/local/bin/perl # Either return to the list_vars.cgi page with new variables for editing, # or save those that were edited require './mysql-lib.pl'; $access{'perms'} == 1 || &error($text{'vars_ecannot'}); &ReadParse(); @d = split(/\0/, $in{'d'}); if ($in{'save'} || !@d) { # Update edited $count = 0; foreach $v (keys %in) { if ($v =~ /^value_(\S+)$/) { &execute_sql_logged($master_db, "set global $1 = $in{$v}"); $first ||= $1; $count++; } } &webmin_log("set", undef, $count); &redirect("list_vars.cgi?search=".&urlize($in{'search'})."#$first"); } else { # Return to list page, but in edit mode &redirect("list_vars.cgi?search=".&urlize($in{'search'})."&". join("&", map { "d=".&urlize($_) } @d). "#".$d[0]); } mysql/edit_table.cgi0000755000567100000120000000536711220734044014476 0ustar jcameronwheel#!/usr/local/bin/perl # edit_table.cgi # Display the structure of some table require './mysql-lib.pl'; &ReadParse(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); if ($access{'edonly'}) { &redirect("view_table.cgi?db=$in{'db'}&table=".&urlize($in{'table'})); exit; } $desc = &text('table_header', "$in{'table'}", "$in{'db'}"); &ui_print_header($desc, $text{'table_title'}, "", "edit_table"); print &ui_form_start("delete_fields.cgi", "post"); print &ui_hidden("db", $in{'db'}),"\n"; print &ui_hidden("table", $in{'table'}),"\n"; @desc = &table_structure($in{'db'}, $in{'table'}); @tds = ( "width=5" ); @rowlinks = ( &select_all_link("d"), &select_invert_link("d") ); print &ui_links_row(\@rowlinks); print &ui_columns_start([ "", $text{'table_field'}, $text{'table_type'}, $text{'table_null'}, $text{'table_key'}, $text{'table_default'}, $text{'table_extra'} ], 100, 0, \@tds); $i = 0; foreach $r (@desc) { local @cols; push(@cols, "".&html_escape($r->{'field'}).""); push(@cols, &html_escape($r->{'type'})); push(@cols, $r->{'null'} eq 'YES' ? $text{'yes'} : $text{'no'}); push(@cols, $r->{'key'} eq 'PRI' ? $text{'table_pri'} : $r->{'key'} eq 'MUL' ? $text{'table_mul'} : $text{'table_none'}); push(@cols, &html_escape(defined($r->{'default'}) ? $r->{'default'} : 'NULL')); push(@cols, &html_escape($r->{'extra'})); print &ui_checked_columns_row(\@cols, \@tds, "d", $r->{'field'}); $i++; } print &ui_columns_end(); print &ui_links_row(\@rowlinks); print &ui_form_end([ [ "delete", $text{'table_delete'} ] ]); $hiddens = &ui_hidden("db", $in{'db'}).&ui_hidden("table", $in{'table'}); print "\n"; # Add field button print &ui_form_start("edit_field.cgi"); print $hiddens; print "",&ui_form_end(); # View and edit data button print &ui_form_start("view_table.cgi", "form-data"); print $hiddens; print "",&ui_form_end(); # CSV export button print &ui_form_start("csv_form.cgi"); print $hiddens; print "",&ui_form_end(); if ($access{'indexes'}) { # Create index button print &ui_form_start("edit_index.cgi"); print $hiddens; print "",&ui_form_end(); } # Drop table button print &ui_form_start("drop_table.cgi"); print $hiddens; print "",&ui_form_end(); print "
",&ui_submit($text{'table_add'}); print &ui_select("type", undef, \@type_list); print "",&ui_submit($text{'table_data'}); print "",&ui_submit($text{'table_csv'}); print "",&ui_submit($text{'table_index'}); print "",&ui_submit($text{'table_drop'}); print "
\n"; &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); mysql/images/0000755000567100000120000000000011220734045013146 5ustar jcameronwheelmysql/images/mysql.gif0000644000567100000120000000450311220734044015003 0ustar jcameronwheelGIF89a0rrrUUU999!Made with GIMP!,0I8@!qE}!)Etmx|pM@0 eI: fgRO"4p ރzoe]xoaj"{Fsl|buTJmsS$~]GFc.r!!$=TbGYBCF$5vi#/#iC6mm jf(Bޮ9P.`+pgl1@'i@X!UCHL(z q` Ր"7Tc[I9`)D.HG_R NP=x aH!}X&|8-iS1&ilj(fv@2D^Bɦ; w@7n&5Z#|&]Ct R2i"gR&b=pF>`#"}Ii&e@\0tlr{U*0Ҡ|DV8)ɩHE7<:Aci<-mUzD4SjbCEZo]kK #DQ jyHC"[C3Q٪%YudS9+$lGQ38O[YY~'4o9ƕ V @_ݥÅS}$!CJ+a:}%[ʵA}AdmJad;ֈI DS V%X޻%_(Ko죨PsXa<hkپhJy*O (d%c_*û<39ޟz0W zp:G%oqHI$\20R%LIiZ&:P\W?x;; _`;ҵl'(Dveԍzqd8B/²prqte` =,m0Pr J$j5O4!ӈfc)h=ˑ!ZsD? M& @ 8)}6~d"tc25@RޠC aveYVB0HVk]qRz"g@!`cЍ痮!ɺB?GW?*x¤U{L&Hoif O䥘oUrҴgo$2ɸ9bs7 *!~HQC R -isbj>c\#Tr0T4 'u3GLT2})j7+bX)nC;/Ѕ@ί:[ H5\a C%@/[>SG Ō:"" zLa~>Opp:/ r\3Jt '@2 CASyGSp!N.-f66/ |qGPaA)h:et|gs?% 7 #qĄ@Bn.I )`J(Ddi`όn,i ? W:H^ (mY[+.2NW/( "@fîF(u?`w Mr'947Mív*MzV9LZ܋~CG+E;>'N L79, ȓh(w;mysql/images/vars.gif0000744000567100000120000000046211220734044014612 0ustar jcameronwheelGIF89a00UUU999rrr㎎! ,00I8ͻρ 1AS!p r+r}co3~ q ;"%BԆ3O>+e9%[=(VAh<RD%EG1YB(c?+VC0GH+cBhB%]F:QM)lF/ZN,fK*UO9cJG]LGUOAdL3rH7STKU-mK,kK5SS6ST.dO=kM=dR'_R7MYEgSQ]Y6|R5pUDeY?V`,qV@[^:zV1SBvW6wX+\]J_]BmYDwW{VFa]RqYLSf%r[8l]7XbEu\1VcQcd's]?n]Tdd4Xh0kaGrb0~_8me1mcRlf=fh>Zm>a@{d@dm.xeE`\bm:bGcOkhbrhQmn+rgg^QWt7{gQwiNgoHnk^{jDfoT`w$l4qnMet6~i[pt!f]iqacy0kImBwt8pBxtAxpjmPpLtwKwtcjTystqvqpiuNuSsTs\zx\l#v\vfzPt^z|Vv}]rc|C}>{N2y]O{Xxn{p{@ASz{YZ`Jsaux:dj{1]^fR;kxiGzyp_jibpezu{8H]v=Q~IJƷ͸|n\ùl°oˡͶϿ܏!Adobe ImageReady! ,00 H*\(P?ȏEٳw}H``\q󦎝礍,I:l=ΛNih ɓR)4hU)lޘZodH %E!@I"EA %(æuIz`:$R( | Uh%c2 C`Y!̸rƙ'(8C*9BK#z̀[$|! lXA\>ZHn~XC D+w C WMT4rBH5 ! 6l*^2$ ` P@'xH $s,q|A4"#B3 E!1AP\P,`,H1+Ay $_A{!@1. u#P,00A  D(V`>!B b6$CR3BE RY )T1x8F"3 M 3>rLA8P0 (-0"~LI2` 4G T v!f2!: !I7&,8b CCsX0L892J F` !=C6Ĥc_/,'H! $x@2"-.t "l&M:TP?ts cF{ȀEN<ݼrԍ/n DBLGBK ʳBmO2$3TLIrQCQH6x& )2Dy!pF$,O0$f4O?pF%C'ࡋ&s8Q?јKcBy#7='m8,#,s2Fw8D"?[]|e\1p&@ ֦hȂ`l$'I;mysql/images/delete.gif0000644000567100000120000000010211220734044015067 0ustar jcameronwheelGIF87a xx, i @ҊӭzOet36F;mysql/images/tprivs.gif0000644000567100000120000000067711220734044015175 0ustar jcameronwheelGIF89a00`d`!Made with GIMP!,00x0I=$W`YhhBjtm۫0A +' RH}~СO$]$'V=&ɯ;T >,u9!&#~!a$µ˫vğ%д9y'ר͆ܨժ"wġ%Pߴz4+ ;O2^{xs?[C>Cilqn 72cL3`"$0VJt+bMZSY({TN!%uQ;AKChӦ%$ʅ;b] %߿ ;mysql/images/icon.gif0000644000567100000120000000254211220734044014567 0ustar jcameronwheelGIF89a00LWEVRJQaoƗI{O]xp5酵œ̀Ü2~ʧղQ/[4rcڈuu3pm jU,)b1+L5q2peyeng:ܨ߯DߘΆݫ; VǴoF8rCek$.,ґߗFdfl|n lqrFRh'|1hhڣՙ՗>f\ kԔ ؠڤюOif_(|}i"`PxH ١٣z^ɵܽ*}̃ó՘e]faםs忣ԝ!x%z⹌7^!,00H*\ȰÇ#JHŋ3jȱǏ =0 B @@Ƀ 4pB ._@ dР<DE@B&N@EBE,h 1ʘaF 6nđBQ;x(GQ A0(8HF I&GtJ)PRʍ XC,(j]x #f1dʘ9M5kش! qș30:v ēG>@*d`C)ZĈ 9^Q$DI! d%wP&h '6E'|(2R)J*@* `E t(P",b-"/:(&._<0@ BQP/B/kG0\2 1 !$rL'<#2(ɞˌL33D#%PS)\M6ژhjlM77NCT J嘣9@:AN;;#ϪC0 Qϰs>4G0c>0D ?#ֵfvkQ@;mysql/images/users.gif0000644000567100000120000000044511220734044015000 0ustar jcameronwheelGIF89a00fff!Made with GIMP!,0080I!˥#]52D*P2I뻅 C&{)G3i1V?_ Y/$ fzwY}x:{XY~]tX)iq#)+,YSf@~vowZ@}N AKJT')*>+Ţ˭ҶдӨ׸¡骖-1ƍ$P\P,]qy[+DxCẆ2HvdGRXy0'aPᅾ{m%N24JqEџ(ޒڳ#;mysql/images/hosts.gif0000644000567100000120000000063411220734044014777 0ustar jcameronwheelGIF89a00[[[!Made with GIMP!,00H06@8KA_mXe%Brm 7ܤƠpAD.)(ARR]Ӗisu֕ 4iʖnpCWLndtQZ 3(R5( xyjqXr.1cu^OYRJ4z *žCʩGIȒlԻ?hz=ශLh譸p0`90Œ` N(DF#X<̇P0E%r*HY"`*UVB̛t8iI\4hMRIT%=oTKrV+D`$;mysql/images/view.gif0000644000567100000120000000362411220734044014613 0ustar jcameronwheelGIF89a00>>Dnrl̊ZZ\NNLz~|FFDffd􎒌zztܦVVTvrtNJLnnlFBDԊbbd¼ܦb^dVR\~JJLBBDrvt^^\RRTjjlĎrrlRNT~~|ƼJFLjfl쪪ZV\vvtrnt¼B>DԊ^ZdNNTFFLfflzz|VV\NJTnntFBL䦦JJTBBL^^d̢rrt~~ܒvv|IJ!,00?H*\ȰÇ#JHQ?<|SQ%xhqrLx`pK th бd''p rƋnCE?,H3#c@HC4uLL8>Pʀb ݛ9E# h[߽R  8*ș1oY]EY !,P@Qe֐}f͖%|ϟ-@| 8 tp+C2F6xQF͕.F TІa`yAK4HHfsexj"(@B"tK eacܡm("zh<`[ 0 jȑb 8rY30( h13xA$081G ,[\1 d0( a&]QGΕ'dމ". P Ac0I?F[:zj^!(q Ѕ #`Pgp/xdGP .`)GЀ RQ0j$ 9с*9x9LNAfl9Bw%P6,)n-g@8 @^ ޒ儀hv2 D g 1DZ68j1hi ߺ) adFT 0E7Àd1.pGg`l 4ʅh{'0s mPQ 1Ȑ0|@d1 MØ-AB)4!ȉL"pG@fd@2 V?X+p-Bqv c@E|tsiB (0Exy.0g84 3hІ_@/d7ln@f 26 mr_ f2x  Kh~р"?@,x.L@!Ѓh0!h @)0a }Hbd@ q҇6a 4pra pV0=XEew`!XPƄ!KX/q!iS;* ~ G (BB*򑐌$;mysql/images/.xvpics/0000755000567100000120000000000011220734045014540 5ustar jcameronwheelmysql/images/.xvpics/index.gif0000664000567100000120000000450511220734044016343 0ustar jcameronwheelP7 332 #IMGINFO:48x48 Indexed (651 bytes) #END_OF_COMMENTS 48 48 255 I$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶I$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶I$III$$Iڷ$%HIےI$I۶I$IH%%۵IH$۶HH%$mH۶$I$I۶$IH%Hn$۶$III۶IHI%ۑڷ$IIH۶$I$I۶H%mImmIII۶H%mImHII$ImI۶$III۶$I$I۶IHH۶%HI$Im%ڷ$IIII۶I%m$۶$I$I۶$I$Iڷmڒm$IIIڷ%HH%%I$IIڶImI۶nln%H۶HI%IImH%ImI$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶I$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶I$III۶H%IIڷHI%Iڷ$II%ڷڶ$III۶۶I$I۶m(IHEm$mEmII׶$IEIڷE(IE۶)I۶HJHHIHHI$HII%ڷڶ$IIIڶI$II۶$I$۶(Em۶mm$n$I۶I$II۶%H%I۶)I۶IH%$ڷ$mmmn$Iڷ$IIHڷH%IHI$۶I$Im%IHI%mڒmnnmI$II۶%H%I۶ڶI$IIIIII%$۶HIH%HI۶$I$I۶I$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶I$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶۶۶H%ڷ۶ڷ$IHIے$II۶$I$۶$I$I۶HIIHڶ%IHIHmI$IIۑ%Im%۶$I$I۶HIIH%HڶHIIHJڶmIIH%HJH۶$I$I۶$ImImII۵ڶIIH%m۶HIIH%HH%mI$I۶I$I%m$I۶HI%m۶IHI%mڶmnn$mI$I۶I$I%m$I۶HI%m۶%H$InI$II۶ڶ$HmI۶ImIHImII۶ڷ$mI%ڷI$II۶IH%I۶%HI%۶ڶ%HIIڶ%HII۶I$II۶۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶HI$I۶۶H%%H%ڷHI%Iڷ$I%Iڷڶ$II%۶I$I۶I%(DۺE(Emַ(EHI%HEI۶D)HE۶)I۶Im$%IImmmm۶H۶$II$I$I໶I$IIEMDNnhHI$$LIEH)I۶I$II$IIIn$%ImIIHIIHے%$IIIHڷI$۶I$ImI۶HIۑI$mHII۶IHI%IڷI$IIInڷHI%%mmIm۶۶nڶ$III۶۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶HI$I۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶HI$I۶۶$III۶H%IIڷ$I%Iڷ$II%ڷڶ$III۶$I$I۶HIm$ڒIHInHI%Iڷ$II%I$I۶I$$I%ڒImn$$mmI$I$۶۶$IIHڷI$I۶I$ImnI۶HJ%mnIH%Iڷ$II%ڷڶI$I۶I$Hnm%$mn$$mH$%H%۶ڷ$IHIڶI$I۶I$I%%mnI$mII%n$I$۶۶$IIHڷ۶۶nHI۶H%m$۶$I%H۶۶$II$۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶HI$I۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶HI$I۶I$II۶%H%I۶ڶ%HI%۶ڶ%HIIڶI$II۶HI$Imysql/images/index.gif0000744000567100000120000000121311220734044014741 0ustar jcameronwheelGIF89a00ǎ999UUUrrr! ,00I8 `P Ahy <d0I)`0 ߭#vNB>t]`BfY2pz`dWqfv *vz8P>rd 4vc+ll]g" o]p'oe ug  8=*Xo#JYJJRx8{ZԘ.P)#rJe։*:Y> 0zӖ5:8) "^#J+ 0R| So^M1C (DE%LA^RrKv& .N;+xY" B8%0aHԔS' B & QQ(Lc MWAkaLla{pEo6 5[֍%,Ar*)<6 kaLMMmEcn&PxLs3cj!Jb79ZF"1D0iU / XYK'=!_+ ~ߞ'x:6]-K*q~~Q$"@H~eN4d$Hފ,K;mysql/images/edit.gif0000644000567100000120000000007411220734044014562 0ustar jcameronwheelGIF87a , ox`IR`ofO ;mysql/images/procs.gif0000644000567100000120000000055411220734044014766 0ustar jcameronwheelGIF87a00̙fff,000@87&:Cip-PX ιt B]ƀ_j]3rަZyv#,bt/c5% x>oBx %<0{NwyXsFzPj_Tod@m YHO弐i:daĖ:-*Q eF~WiĠ*ΆB TjVDOi)qViZQp]5.۹oz+ڟvˉPUKHX̸;mysql/images/smallicon.gif0000664000567100000120000000114511220734044015620 0ustar jcameronwheelGIF87aMК,4ܩ̈́f\ kԔ ؠڤюOif_(|}i"`PxH ١٣z^ɵܽ*}̃ó՘e]faםs忣ԝ!x%z⹌7^!,00H*\ȰÇ#JHŋ3jȱǏ =0 B @@Ƀ 4pB ._@ dР<DE@B&N@EBE,h 1ʘaF 6nđBQ;x(GQ A0(8HF I&GtJ)PRʍ XC,(j]x #f1dʘ9M5kش! qș30:v ēG>@*d`C)ZĈ 9^Q$DI! d%wP&h '6E'|(2R)J*@* `E t(P",b-"/:(&._<0@ BQP/B/kG0\2 1 !$rL'<#2(ɞˌL33D#%PS)\M6ژhjlM77NCT J嘣9@:AN;;#ϪC0 Qϰs>4G0c>0D ?#ֵfvkQ@;mysql/save_view.cgi0000775000567100000120000000354311220734044014366 0ustar jcameronwheel#!/usr/local/bin/perl # Create, modify or delete a view require './mysql-lib.pl'; &ReadParse(); &error_setup($text{'view_err'}); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); $access{'views'} || &error($text{'view_ecannot'}); if ($in{'delete'}) { # Just drop the view $sql = "drop view "."estr($in{'old'}); &execute_sql_logged($in{'db'}, $sql); &webmin_log("delete", "view", $in{'old'}, \%in); } else { # Validate inputs if (!$in{'old'}) { $in{'name'} =~ /^\S+$/ || &error($text{'view_ename'}); @views = &list_views($in{'db'}); &indexof($in{'name'}, @views) >= 0 && &error($text{'view_eclash'}); @tables = &list_tables($in{'db'}); &indexof($in{'name'}, @tables) >= 0 && &error($text{'view_eclash2'}); } $in{'query'} =~ /\S/ || &error($text{'view_equery'}); $in{'query'} =~ s/\r|\n/ /g; $in{'definer_def'} || $in{'definer'} =~ /\S/ || &error($text{'view_edefiner'}); if ($in{'old'}) { # Alter the existing view $sql = "alter ". "algorithm = $in{'algorithm'} ". "definer = $in{'definer'} ". "sql security $in{'security'} ". "view "."estr($in{'old'})." ". "as $in{'query'} ". ($in{'check'} ? "with $in{'check'} check option" : ""); } else { # Create a new view $sql = "create ". "algorithm = $in{'algorithm'} ". ($in{'definer_def'} ? "" : "definer = $in{'definer'} "). ($in{'security'} ? "sql security $in{'security'} " : ""). "view "."estr($in{'name'})." ". "as $in{'query'} ". ($in{'check'} ? "with $in{'check'} check option" : ""); } &execute_sql_logged($in{'db'}, $sql); if ($in{'old'}) { &webmin_log("modify", "view", $in{'old'}, \%in); } else { &webmin_log("create", "view", $in{'name'}, \%in); } } &redirect("edit_dbase.cgi?db=$in{'db'}"); mysql/delete_fields.cgi0000775000567100000120000000123711220734044015164 0ustar jcameronwheel#!/usr/local/bin/perl # Drop a bunch of fields require './mysql-lib.pl'; &ReadParse(); &error_setup($text{'fdrop_err'}); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); # Validate inputs @d = split(/\0/, $in{'d'}); @d || &error($text{'fdrop_enone'}); @desc = &table_structure($in{'db'}, $in{'table'}); @d < @desc || &error($text{'fdrop_eall'}); # Do the deed foreach $d (@d) { &execute_sql_logged($in{'db'}, "alter table "."estr($in{'table'})." drop "."estr($d)); } &webmin_log("delete", "fields", scalar(@d), \%in); &redirect("edit_table.cgi?db=$in{'db'}&table=".&urlize($in{'table'})); mysql/list_hosts.cgi0000755000567100000120000000314111220734044014561 0ustar jcameronwheel#!/usr/local/bin/perl # list_hosts.cgi # Display host-level permissions require './mysql-lib.pl'; $access{'perms'} || &error($text{'perms_ecannot'}); &ui_print_header(undef, $text{'hosts_title'}, ""); $d = &execute_sql_safe($master_db, "select * from host order by host"); @rowlinks = ( "$text{'hosts_add'}" ); if (@{$d->{'data'}}) { print &ui_form_start("delete_hosts.cgi"); unshift(@rowlinks, &select_all_link("d", 0), &select_invert_link("d", 0) ); print &ui_links_row(\@rowlinks); @tds = ( "width=5" ); print &ui_columns_start([ "", $text{'hosts_db'}, $text{'hosts_host'}, $text{'hosts_perms'} ], 100, 0, \@tds); $i = -1; foreach $u (@{$d->{'data'}}) { $i++; next if ($access{'perms'} == 2 && !&can_edit_db($u->[1])); local @cols; push(@cols, "". ($u->[1] eq '%' || $u->[1] eq '' ? $text{'hosts_any'} : &html_escape($u->[1])).""); push(@cols, $u->[0] eq '%' || $u->[0] eq '' ? $text{'hosts_any'} : &html_escape($u->[0])); local @priv; for($j=2; $j<=&db_priv_cols()+2-1; $j++) { push(@priv, $text{"hosts_priv$j"}) if ($u->[$j] eq 'Y'); } push(@cols, scalar(@priv) == &db_priv_cols() ? $text{'hosts_all'} : !@priv ? $text{'hosts_none'} : join(" | ", @priv)); print &ui_checked_columns_row(\@cols, \@tds, "d", $u->[0]." ".$u->[1]); } print &ui_columns_end(); } else { print "$text{'hosts_empty'}

\n"; } print &ui_links_row(\@rowlinks); print &ui_form_end([ [ "delete", $text{'users_delete'} ]]) if (@{$d->{'data'}}); &ui_print_footer("", $text{'index_return'}); mysql/config-redhat-linux-7.0-*0000644000567100000120000000061711220734044016127 0ustar jcameronwheelstart_cmd=/etc/rc.d/init.d/mysqld start stop_cmd=/etc/rc.d/init.d/mysqld 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/cgi_args.pl0000775000567100000120000000110111220734044014011 0ustar jcameronwheel do 'mysql-lib.pl'; sub cgi_args { my ($cgi) = @_; if ($cgi eq 'list_vars.cgi') { # Works with no args return ''; } elsif ($cgi eq 'edit_dbase.cgi' || $cgi eq 'backup_form.cgi' || $cgi eq 'exec_form.cgi') { # Use default DB return 'db=mysql'; } elsif ($cgi eq 'table_form.cgi') { return 'db=mysql&fields=4'; } elsif ($cgi eq 'edit_view.cgi') { return 'db=mysql&new=1'; } elsif ($cgi eq 'edit_table.cgi' || $cgi eq 'view_table.cgi') { return 'db=mysql&table=user'; } elsif ($cgi eq 'edit_field.cgi') { return 'db=mysql&table=user&idx=0'; } return undef; } mysql/config.info.fi0000644000567100000120000000000011220734044014405 0ustar jcameronwheelmysql/edit_tpriv.cgi0000755000567100000120000000423411220734044014543 0ustar jcameronwheel#!/usr/local/bin/perl # edit_tpriv.cgi # Display a form for editing or creating new table permissions require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if (defined($in{'db'})) { $in{'db'} =~ /^\S+$/ || &error($text{'tpriv_edb'}); &ui_print_header(undef, $text{'tpriv_title1'}, "", "create_tpriv"); } else { $d = &execute_sql_safe($master_db, "select * from tables_priv order by table_name"); $u = $d->{'data'}->[$in{'idx'}]; $access{'perms'} == 1 || &can_edit_db($u->[1]) || &error($text{'perms_edb'}); &ui_print_header(undef, $text{'tpriv_title2'}, "", "edit_tpriv"); } print &ui_form_start("save_tpriv.cgi"); if ($in{'db'}) { print &ui_hidden("db", $in{'db'}); } else { print &ui_hidden("oldhost", $u->[0]); print &ui_hidden("olddb", $u->[1]); print &ui_hidden("olduser", $u->[2]); print &ui_hidden("oldtable", $u->[3]); } print &ui_table_start($text{'tpriv_header'}, undef, 2); # Apply to DB print &ui_table_row($text{'tpriv_db'}, $in{'db'} || $u->[1]); # Apply to table print &ui_table_row($text{'tpriv_table'}, &ui_select("table", $in{'db'} ? '' : $u->[3], [ $in{'db'} ? ( [ '' ] ) : ( ), &list_tables($in{'db'} || $u->[1]) ], 1, 0, 1)); # Apply to user print &ui_table_row($text{'tpriv_user'}, &ui_opt_textbox("user", $u->[2], 20, $text{'tpriv_anon'})); # Apply to host print &ui_table_row($text{'tpriv_host'}, &ui_opt_textbox("host", $u->[0] eq '%' ? '' : $u->[0], 40, $text{'tpriv_any'})); # Table permissions print &ui_table_row($text{'tpriv_perms1'}, &ui_select("perms1", [ split(/,/, $u->[6]) ], [ 'Select','Insert','Update','Delete','Create', 'Drop','Grant','References','Index','Alter', ($mysql_version >= 5 ? ('Create View','Show view') : ( )) ], 4, 1)); # Field permissions print &ui_table_row($text{'tpriv_perms2'}, &ui_select("perms2", [ split(/,/, $u->[7]) ], [ 'Select','Insert','Update','References' ], 4, 1)); print &ui_table_end(); print &ui_form_end([ $in{'db'} ? ( [ undef, $text{'create'} ] ) : ( [ undef, $text{'save'} ], [ 'delete', $text{'delete'} ] ) ]); &ui_print_footer('list_tprivs.cgi', $text{'tprivs_return'}, "", $text{'index_return'}); mysql/config.info0000644000567100000120000000264711220734044014033 0ustar jcameronwheelline1=Configurable options,11 login=Administration login,3,Automatic pass=Administration password,12 perpage=Number of rows to display per page,0,5 style=Show databases and tables as,1,1-List,0-Icons,2-Names only add_mode=Use vertical row editing interface,1,1-Yes,0-No blob_mode=Show blob and text fields as,1,0-Data in table,1-Links to download nodbi=Use DBI to connect if available?,1,0-Yes,1-No nopwd=Use MYSQL_PWD variable to pass password?,1,0-Yes,1-No date_subs=Do strftime substitution of backup destinations?,1,1-Yes,0-No passwd_mode=Password hashing mode,1,1-Old,0-Default encoding=Encoding for database content,3,Default (from current language) max_dbs=Maximum number of databases and tables to display,0,5 max_text=Maximum display length for text fields,3,Unlimited charset=Character set for MySQL data,15,charset line2=System configuration,11 mysqlshow=Path to mysqlshow command,0 mysqladmin=Path to mysqladmin command,0 mysql=Path to mysql command,0 mysqldump=Path to mysqldump command,0 mysqlimport=Path to mysqlimport command,0 mysqld=Path to mysqld command,3,Automatic start_cmd=Command to start MySQL server,0 stop_cmd=Command to stop MySQL server,3,Automatic mysql_libs=Path to MySQL shared libraries directory,3,None mysql_data=Path to MySQL databases directory,3,None host=MySQL host to connect to,3,localhost port=MySQL port to connect to,3,Default sock=MySQL socket file,3,Default my_cnf=MySQL configuration file,0 mysql/negativeacl0000664000567100000120000000001011220734044014076 0ustar jcameronwheelfiles=0 mysql/config.info.hu0000644000567100000120000000236711220734044014445 0ustar jcameronwheelline1=Konfigurcis belltsok,11 login=Adminisztrtori felhasznli nv,0 pass=Adminisztrtori jelsz,0 perpage=A megjelentend sorok szma oldalanknt,0 style=Mutassam az adatbzisokat s tblkat mint,1,1-Listaknt,0-Ikonknt add_mode=Vertiklis sor szerkesztsi kinzet,1,1-Igen,0-Nem blob_mode=Jelentse meg a blob s szveges mezt mint,1,0-Adatknt a tblban,1-Linkknt letltsre nodbi=Hasznljam a DBI -t csatlakozsra ha ltezik?,1,0-Igen,1-Nem date_subs=Csinljon strftime cserlt a msolati clon?1,1-Igen,0-Nem passwd_mode=Jelsz kdolsi md,1,1-Rgi,0-ltalnos encoding=Elkdolja az adatbzis tartalmat,3,ltalnos max_dbs=Maximlis adatbzis s tbla megjelents,0 line2=Rendszer belltsok,11 mysqlshow=A mysqlshow parancs tvonala,0 mysqladmin=A mysqladmin parancs tvonala,0 mysql=A mysql parancs tvonala,0 mysqldump=A mysqldump parancs tvonala,0 mysqlimport=A mysqlimport parancs tvonala,0 start_cmd=A mysql szerver indt parancssora,0 stop_cmd=A mysql szerver lellt parancssora,3,Automatikus mysql_libs=A mysql megosztott knyvtrainak tvonala,3,Nincs mysql_data=A MySQL adatbizsok knyvtra,3,Nincs host=MySQL hoszt a csatlakozshoz,3,localhost port=MySQL port a csatlakozshoz,3,ltalnos sock=MySQL socket file,3,ltalnos mysql/config-redhat-linux0000644000567100000120000000061511220734044015474 0ustar jcameronwheelstart_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/config.info.nl0000644000567100000120000000301411220734044014430 0ustar jcameronwheelline1=Configureerbare opties,11 login=Administratie login,3,Automatisch pass=Administratie wachtwoord,12 perpage=Aantal rijen om te laten zien per pagina,0,5 style=Laat databasen en tabellen zien als,1,1-Lijst,0-Iconen,2-Alleen namen add_mode=Gebruik een verticale rij bewerkings interface,1,1-Ja,0-Nee blob_mode=Laat blob en tekst velden zien als,1,0-Data in tabel,1-Links om te downloaden nodbi=Gebruik DBI om te verbinden indien beschikbaar?,1,0-Ja,1-Nee date_subs=Doe een strftime toevoeging van backup bestemmingen?,1,1-Ja,0-Nee passwd_mode=Wachtwoord hashing mode,1,1-Oud,0-Standaard encoding=Versleutelen van database inhoud,3,Standaard ( van huidig taal) max_dbs=Maximum aantal databases en tabellen om te laten zien,0,5 max_text=Maximum lengte voor tekst velden om te laten zien,3,Ongelimiteerd charset=Karakterset voor MySQL data,15,charset line2=Systeem configuratie,11 mysqlshow=Pad naar de mysqlshow opdracht,0 mysqladmin=Pad naar de mysqladmin opdracht,0 mysql=Pad naar de mysql opdracht,0 mysqldump=Pad naar de mysqldump opdracht,0 mysqlimport=Pad naar de mysqlimport opdracht,0 mysqld=Pad naar de mysqld opdracht,3,Automatisch start_cmd=Opdracht om MySQL server te starten,0 stop_cmd=Opdracht om MySQL server te stoppen,3,Automatisch mysql_libs=Pad naar de MySQL gedeelde bibliotheken directory,3,Geen mysql_data=Pad naar de MySQL databasis directory,3,Geen host=MySQL host om mee te verbinden,3,localhost port=MySQL poort om mee te verbinden,3,Standaard sock=MySQL socket file,3,Standaard my_cnf=MySQL configuratie file,0 mysql/config-solaris-90000664000567100000120000000073611220734044014720 0ustar jcameronwheelstart_cmd=cd /opt/sfw/mysql ; (./bin/safe_mysqld || ./bin/mysqld_safe) & perpage=25 mysql=/opt/sfw/mysql/bin/mysql mysqldump=/opt/sfw/mysql/bin/mysqldump mysqlimport=/opt/sfw/mysql/bin/mysqlimport pass=foo mysqlshow=/opt/sfw/mysql/bin/mysqlshow login=root mysql_libs=/opt/sfw/mysql/lib mysqladmin=/opt/sfw/mysql/bin/mysqladmin style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 mysql_data=/var/mysql max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/drop_table.cgi0000755000567100000120000000236611220734044014511 0ustar jcameronwheel#!/usr/local/bin/perl # drop_table.cgi # Delete an existing table require './mysql-lib.pl'; &ReadParse(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); if ($in{'confirm'}) { # Drop the table &error_setup($text{'tdrop_err'}); &execute_sql_logged($in{'db'}, "drop table "."estr($in{'table'})); &webmin_log("delete", "table", $in{'table'}, \%in); &redirect("edit_dbase.cgi?db=$in{'db'}"); } else { # Ask the user if he is sure.. &ui_print_header(undef, $text{'tdrop_title'}, ""); @tables = &list_tables($in{'db'}); $d = &execute_sql($in{'db'}, "select count(*) from "."estr($in{'table'})); $rows = $d->{'data'}->[0]->[0]; print "

",&text('tdrop_rusure', "$in{'table'}", "$in{'db'}", $rows),"

\n"; print "

\n"; print "\n"; print "\n"; print "\n"; print "
\n"; &ui_print_footer("edit_table.cgi?db=$in{'db'}&table=$in{'table'}", $text{'table_return'}, "edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); } mysql/csv_form.cgi0000775000567100000120000000322411220734044014210 0ustar jcameronwheel#!/usr/local/bin/perl # Show a form for exporting CSV data require './mysql-lib.pl'; &ReadParse(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); $desc = &text('table_header', "$in{'table'}", "$in{'db'}"); &ui_print_header($desc, $text{'csv_title'}, "", "csv"); print &ui_form_start("csv.cgi/$in{'table'}.csv", "post"); print &ui_hidden("db", $in{'db'}),"\n"; print &ui_hidden("table", $in{'table'}),"\n"; print &ui_table_start($text{'csv_header'}, undef, 2); print &ui_table_row($text{'csv_format'}, &ui_radio("format", 0, [ [ 0, $text{'csv_format0'} ], [ 1, $text{'csv_format1'} ], [ 2, $text{'csv_format2'} ] ])); print &ui_table_row($text{'csv_headers'}, &ui_yesno_radio("headers", 0)); if ($access{'buser'}) { # Only allow saving to file if a backup user is configured print &ui_table_row($text{'csv_dest'}, &ui_radio("dest", 0, [ [ 0, $text{'csv_browser'}."
" ], [ 1, $text{'csv_file'} ] ])."\n". &ui_textbox("file", undef, 40)." ". &file_chooser_button("file")); } # Rows to select print &ui_table_row($text{'csv_where'}, &ui_opt_textbox("where", undef, 30, $text{'csv_all'})); # Columns to select @str = &table_structure($in{'db'}, $in{'table'}); @cols = map { $_->{'field'} } @str; print &ui_table_row($text{'csv_cols'}, &ui_select("cols", \@cols, [ map { [ $_->{'field'}, "$_->{'field'} - $_->{'type'}" ] } @str ], 5, 1)); print &ui_table_end(); print &ui_form_end([ [ "ok", $text{'csv_ok'} ] ]); &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); mysql/config.info.ru_SU0000644000567100000120000000147311220734044015063 0ustar jcameronwheelline1= ,11 login= ,0 pass= ,12 perpage= , ,0 style= ,1,1-,0- add_mode= ,1,1-,0- nodbi= DBI ?,1,0-,1- line2= ,11 mysqlshow= mysqlshow,0 mysqladmin= mysqladmin,0 mysql= mysql,0 mysqldump= mysqldump,0 mysqlimport= mysqlimport,0 start_cmd= MySQL,0 stop_cmd= MySQL,3, mysql_libs= MySQL,3, host= MySQL ,3,localhost sock= MySQL,3, mysql/config-coherent-linux0000664000567100000120000000061711220734044016040 0ustar jcameronwheelstart_cmd=/etc/rc.d/init.d/mysqld start stop_cmd=/etc/rc.d/init.d/mysqld 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.info.es0000644000567100000120000000144311220734044014432 0ustar jcameronwheelmysqlshow=Trayectoria a comando mysqlshow,0 mysqladmin=Trayectoria a comando mysqladmin,0 mysql=Trayectoria a comando mysql,0 mysqldump=Trayectoria a comando mysqldump,0 mysqlimport=Trayectoria a comando mysqlimport,0 start_cmd=Comando para arrancar servidor mysql,0 stop_cmd=Comando para parar servidor mysql,3,Automtico mysql_libs=Trayectoria a directorio de bibliotecas compartidas de mysql,3,Ninguna login=Login de administracin,0, pass=Clave de acceso de administracin,0 perpage=Nmero de filas a mostrar por pagina,0 style=Mostrar bases de datos y tablas como,1,1-Lista,0-Iconos add_mode=Usar interfaz vertical para aadir filas,1,1-S,0-No host=Mquina MySQL a donde conectarse,3,Local sock=Archivo de socket de MySQL,3,Por defecto nodbi=Uso DBI para conectar si est disponible?,1,0-S,1-No mysql/config-aix0000644000567100000120000000071311220734044013650 0ustar jcameronwheelstart_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-united-linux0000644000567100000120000000060311220734044015512 0ustar jcameronwheelstart_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/delete_cprivs.cgi0000775000567100000120000000144611220734044015226 0ustar jcameronwheel#!/usr/local/bin/perl # Delete several selected column permissions require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_edb'}); &error_setup($text{'cprivs_derr'}); @d = split(/\0/, $in{'d'}); @d || &error($text{'cprivs_enone'}); # Delete the table privs foreach $hdutc (@d) { ($host, $db, $user, $table, $column) = split(/ /, $hdutc); $access{'perms'} == 1 || &can_edit_db($db) || &error($text{'perms_edb'}); &execute_sql_logged($master_db, "delete from columns_priv where host = '$host' ". "and db = '$db' ". "and user = '$user' ". "and table_name = '$table' ". "and column_name = '$column'"); } &execute_sql_logged($master_db, 'flush privileges'); # Log it &webmin_log("delete", "cprivs", scalar(@d)); &redirect("list_cprivs.cgi"); mysql/kill_procs.cgi0000775000567100000120000000060711220734044014535 0ustar jcameronwheel#!/usr/local/bin/perl # Terminate several mysql connections require './mysql-lib.pl'; &error_setup($text{'kill_err'}); $access{'perms'} == 1 || &error($text{'kill_ecannot'}); &ReadParse(); @d = split(/\0/, $in{'d'}); @d || &error($text{'kill_enone'}); foreach $d (@d) { &execute_sql_logged($master_db, "kill $d"); } &webmin_log("kill", undef, scalar(@d)); &redirect("list_procs.cgi"); mysql/cpan_modules.pl0000775000567100000120000000012411220734044014710 0ustar jcameronwheel require 'mysql-lib.pl'; sub cpan_recommended { return ( "DBI", "DBD::mysql" ); } mysql/newdb.cgi0000755000567100000120000000202111220734044013461 0ustar jcameronwheel#!/usr/local/bin/perl # newdb.cgi # Create a new database with one optional table require './mysql-lib.pl'; &ReadParse(); $access{'create'} || &error($text{'newdb_ecannot'}); &error_setup($text{'newdb_err'}); # Make sure maximum databases limit has not been exceeded @alldbs = &list_databases(); @titles = grep { &can_edit_db($_) } @alldbs; if ($access{'create'} == 2 && @titles >= $access{'max'}) { &error($text{'newdb_ecannot2'}); } $in{'db'} =~ /^[A-z0-9\.\-\s]+$/ || &error($text{'newdb_edb'}); if (!$in{'table_def'}) { @sql = &parse_table_form([ ], $in{'table'}); } &execute_sql_logged($master_db, "create database "."estr($in{'db'}). ($in{'charset'} ? " character set $in{'charset'}" : "")); &webmin_log("create", "db", $in{'db'}); if (@sql) { foreach $sql (@sql) { &execute_sql_logged($in{'db'}, $sql); } &webmin_log("create", "table", $in{'table'}, \%in); } if ($access{'dbs'} ne '*') { $access{'dbs'} .= " " if ($access{'dbs'}); $access{'dbs'} .= $in{'db'}; &save_module_acl(\%access); } &redirect(""); mysql/list_tprivs.cgi0000755000567100000120000000405611220734044014756 0ustar jcameronwheel#!/usr/local/bin/perl # list_tprivs.cgi # Display a list of table priviliges require './mysql-lib.pl'; $access{'perms'} || &error($text{'perms_ecannot'}); &ui_print_header(undef, $text{'tprivs_title'}, "", "tprivs"); $d = &execute_sql_safe($master_db, "select * from tables_priv order by table_name"); if (@{$d->{'data'}}) { print &ui_form_start("delete_tprivs.cgi", "post"); @rowlinks = ( &select_all_link("d", 0), &select_invert_link("d", 0) ); print &ui_links_row(\@rowlinks); @tds = ( "width=5" ); print &ui_columns_start([ "", $text{'tprivs_table'}, $text{'tprivs_db'}, $text{'tprivs_host'}, $text{'tprivs_user'}, $text{'tprivs_privs1'}, $text{'tprivs_privs2'} ], 100, 0, \@tds); $i = -1; foreach $u (@{$d->{'data'}}) { $i++; next if ($access{'perms'} == 2 && !&can_edit_db($u->[1])); local @cols; push(@cols, "". &html_escape($u->[3]).""); push(@cols, &html_escape($u->[1])); push(@cols, $u->[0] eq '' || $u->[0] eq '%' ? $text{'tprivs_all'} : &html_escape($u->[0])); push(@cols, $u->[2] ? &html_escape($u->[2]) : $text{'tprivs_anon'}); push(@cols, !$u->[6] ? $text{'tprivs_none'} : join(" | ",split(/[, ]+/, $u->[6]))); push(@cols, !$u->[7] ? $text{'tprivs_none'} : join(" | ",split(/[, ]+/, $u->[7]))); print &ui_checked_columns_row(\@cols, \@tds, "d", join(" ", @$u[0..3])); } print &ui_columns_end(); print &ui_links_row(\@rowlinks); print &ui_form_end([ [ "delete", $text{'users_delete'} ] ]); } else { print "$text{'tprivs_norows'}

\n"; } &show_button(); &ui_print_footer("", $text{'index_return'}); sub show_button { print &ui_form_start("edit_tpriv.cgi"); print &ui_submit($text{'tprivs_add'}); local @dbs = sort { $a cmp $b } &list_databases(); if (@dbs > $max_dbs) { # Just show DB name print &ui_textbox("db", undef, 20); } else { # DB selector print &ui_select("db", undef, [ grep { $access{'perms'} == 1 || &can_edit_db($_) } &list_databases() ]); } print &ui_form_end(); } mysql/config-mandrake-linux-10.1-*0000644000567100000120000000061711220734044016515 0ustar jcameronwheelstart_cmd=/etc/rc.d/init.d/mysqld start stop_cmd=/etc/rc.d/init.d/mysqld 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/install_check.pl0000775000567100000120000000072611220734044015052 0ustar jcameronwheel# install_check.pl do 'mysql-lib.pl'; # is_installed(mode) # For mode 1, returns 2 if the server is installed and configured for use by # Webmin, 1 if installed but not configured, or 0 otherwise. # For mode 0, returns 1 if installed, 0 if not sub is_installed { return 0 if (!-x $config{'mysqladmin'} || !-x $config{'mysql'}); return 0 if (&get_mysql_version(\$dummy) <= 0); if ($_[0]) { # Check if can login return 2 if (&is_mysql_running() == 1); } return 1; } mysql/mysql-lib.pl0000775000567100000120000010301011220734044014146 0ustar jcameronwheel# mysql-lib.pl # Common MySQL functions BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); if ($config{'mysql_libs'}) { $ENV{$gconfig{'ld_env'}} .= ':' if ($ENV{$gconfig{'ld_env'}}); $ENV{$gconfig{'ld_env'}} .= $config{'mysql_libs'}; } if ($config{'mysql'} =~ /^(\S+)\/bin\/mysql$/ && $1 ne '' && $1 ne '/usr') { $ENV{$gconfig{'ld_env'}} .= ':' if ($ENV{$gconfig{'ld_env'}}); $ENV{$gconfig{'ld_env'}} .= "$1/lib"; } if ($module_info{'usermin'}) { # Usermin always runs this module as the logged-in Unix user. # %access is faked up to prevent attempts to create and delete DBs &switch_to_remote_user(); &create_user_config_dirs(); %access = ( 'create', 0, 'delete', 0, 'bpath', '/', 'buser', 'root', 'edonly', 0 ); if ($config{'useident'} ne 'yes') { $mysql_login = $userconfig{'login'}; $mysql_pass = $userconfig{'pass'}; } if (open(VERSION, "$user_module_config_directory/version")) { chop($mysql_version = ); close(VERSION); } $max_dbs = $userconfig{'max_dbs'}; $commands_file = "$user_module_config_directory/commands"; $sql_charset = $userconfig{'charset'}; %displayconfig = %userconfig; } else { # Webmin connects to the database as the user specified in the per-user # or global config %access = &get_module_acl(); if ($access{'user'} && !$use_global_login) { $mysql_login = $access{'user'}; $mysql_pass = $access{'pass'}; } else { $mysql_login = $config{'login'}; $mysql_pass = $config{'pass'}; } if (open(VERSION, "$module_config_directory/version")) { chop($mysql_version = ); close(VERSION); } else { $mysql_version = &get_mysql_version(); } $cron_cmd = "$module_config_directory/backup.pl"; $max_dbs = $config{'max_dbs'}; $commands_file = "$module_config_directory/commands"; $sql_charset = $config{'charset'}; %displayconfig = %config; } $authstr = &make_authstr(); $master_db = 'mysql'; $password_func = $config{'passwd_mode'} ? "old_password" : "password"; @type_list = ('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'float', 'double', 'decimal', 'date', 'datetime', 'timestamp', 'time', 'year', 'char', 'varchar', 'tinyblob', 'tinytext', 'blob', 'text', 'mediumblob', 'mediumtext', 'longblob', 'longtext', 'enum', 'set'); @priv_cols = ('Host', 'User', 'Password', 'Select_priv', 'Insert_priv', 'Update_priv', 'Delete_priv', 'Create_priv', 'Drop_priv', 'Reload_priv', 'Shutdown_priv', 'Process_priv', 'File_priv', 'Grant_priv', 'References_priv', 'Index_priv', 'Alter_priv', 'Show_db_priv', 'Super_priv', 'Create_tmp_table_priv', 'Lock_tables_priv', 'Execute_priv', 'Repl_slave_priv', 'Repl_client_priv', 'Create_view_priv', 'Show_view_priv', 'Create_routine_priv', 'Alter_routine_priv', 'Create_user_priv'); if (!$config{'nodbi'}) { # Check if we have DBI::mysql eval <install_driver("mysql"); EOF } $old_user_priv_cols = $mysql_version >= 4 ? 21 : 14; $old_db_priv_cols = $mysql_version >= 4 ? 12 : 10; @mysql_set_variables = ( "key_buffer", "max_allowed_packet", "sort_buffer", "net_buffer_length", "myisam_sort_buffer_size" ); @mysql_number_variables = ( "table_cache", "max_connections" ); # make_authstr([login], [pass], [host], [port], [sock]) sub make_authstr { local $login = defined($_[0]) ? $_[0] : $mysql_login; local $pass = defined($_[1]) ? $_[1] : $mysql_pass; local $host = defined($_[2]) ? $_[2] : $config{'host'}; local $port = defined($_[3]) ? $_[3] : $config{'port'}; local $sock = defined($_[4]) ? $_[4] : $config{'sock'}; if (&supports_env_pass()) { $ENV{'MYSQL_PWD'} = $pass; } return ($sock ? " -S $sock" : ""). ($host ? " -h $host" : ""). ($port ? " -P $port" : ""). ($login ? " -u ".quotemeta($login) : ""). (&supports_env_pass() ? "" : # Password comes from environment $pass && $mysql_version >= 4.1 ? " --password=".quotemeta($pass) : $pass ? " -p".quotemeta($pass) : ""); } # is_mysql_running() # Returns 1 if mysql is running, 0 if not, or -1 if running but # inaccessible without a password. When called in an array context, also # returns the full error message sub is_mysql_running { # First type regular connection if ($driver_handle && !$config{'nodbi'}) { local $main::error_must_die = 1; local ($data, $rv); eval { $data = &execute_sql_safe(undef, "select version()") }; local $err = $@; $err =~ s/\s+at\s+\S+\s+line.*$//; if ($@ =~ /denied|password/i) { $rv = -1; } elsif ($@ =~ /connect/i) { $rv = 0; } elsif ($data->{'data'}->[0]->[0] =~ /^\d/) { $rv = 1; } if (defined($rv)) { return wantarray ? ( $rv, $err ) : $rv; } } # Fall back to mysqladmin command local $out = `"$config{'mysqladmin'}" $authstr status 2>&1`; local $rv = $out =~ /uptime/i ? 1 : $out =~ /denied|password/i ? -1 : 0; $out =~ s/^.*\Q$config{'mysqladmin'}\E\s*:\s*//; return wantarray ? ($rv, $out) : $rv; } # list_databases() # Returns a list of all databases sub list_databases { local @rv; eval { # First try using SQL local $main::error_must_die = 1; local $t = &execute_sql_safe($master_db, "show databases"); @rv = map { $_->[0] } @{$t->{'data'}}; }; if (!@rv || $@) { # Fall back to mysqlshow command open(DBS, "\"$config{'mysqlshow'}\" $authstr |"); local $t = &parse_mysql_table(DBS); close(DBS); ref($t) || &error("Failed to list databases : $t"); @rv = map { $_->[0] } @{$t->{'data'}}; } return @rv; } # list_tables(database, [empty-if-denied], [no-filter-views]) # Returns a list of tables in some database sub list_tables { my ($db, $empty_denied, $include_views) = @_; my @rv; eval { # First try using SQL local $main::error_must_die = 1; local $t = &execute_sql_safe($db, "show tables"); @rv = map { $_->[0] } @{$t->{'data'}}; }; if ($@) { # Fall back to mysqlshow command local $tspec = $db =~ /_/ ? "%" : ""; open(DBS, "\"$config{'mysqlshow'}\" $authstr ". quotemeta($db)." $tspec 2>&1 |"); local $t = &parse_mysql_table(DBS); close(DBS); if ($t =~ /access denied/i) { if ($empty_denied) { return ( ); } else { &error($text{'edenied'}); } } elsif (!ref($t)) { &error("".&html_escape($t).""); } @rv = map { $_->[0] } @{$t->{'data'}}; } # Filter out views if (!$include_views) { if (&supports_views()) { my %views = map { $_, 1 } &list_views($db); @rv = grep { !$views{$_} } @rv; } } return @rv; } # table_structure(database, table) # Returns a list of hashes detailing the structure of a table sub table_structure { local $s = &execute_sql_safe($_[0], "desc "."estr($_[1])); local (@rv, $r); local (%tp, $i); for($i=0; $i<@{$s->{'titles'}}; $i++) { $tp{lc($s->{'titles'}->[$i])} = $i; } foreach $r (@{$s->{'data'}}) { push(@rv, { 'field' => $r->[$tp{'field'}], 'type' => $r->[$tp{'type'}], 'null' => $r->[$tp{'null'}], 'key' => $r->[$tp{'key'}], 'default' => $r->[$tp{'default'}], 'extra' => $r->[$tp{'extra'}] }); } return @rv; } # table_field_sizes(db, table) # Returns a hash mapping field names to sizes sub table_field_sizes { local %rv; foreach my $s (&table_structure(@_)) { if ($s->{'type'} =~ /^\S+\((\d+)(,\d+)?\)/) { $rv{lc($s->{'field'})} = $1; } } return %rv; } # execute_sql(database, command, [param, ...]) # Executes some SQL and returns the results, after checking for the user's # readonly status. sub execute_sql { return { } if (&is_readonly_mode()); return &execute_sql_safe(@_); } # execute_sql_safe(database, command, [param, ...]) # Executes some SQL and returns the results sub execute_sql_safe { local $sql = $_[1]; @params = @_[2..$#_]; if ($gconfig{'debug_what_sql'}) { # Write to Webmin debug log local $params; for(my $i=0; $i<@params; $i++) { $params .= " ".$i."=".$params[$i]; } &webmin_debug_log('SQL', "db=$_[0] sql=$sql".$params); } $sql =~ s/\\/\\\\/g; if ($driver_handle && !$config{'nodbi'}) { # Use the DBI interface local $cstr = "database=$_[0]"; $cstr .= ";host=$config{'host'}" if ($config{'host'}); $cstr .= ";port=$config{'port'}" if ($config{'port'}); $cstr .= ";mysql_socket=$config{'sock'}" if ($config{'sock'}); $cstr .= ";mysql_read_default_file=$config{'my_cnf'}" if (-r $config{'my_cnf'}); local $dbh = $driver_handle->connect($cstr, $mysql_login, $mysql_pass, { }); $dbh || &error("DBI connect failed : ",$driver_handle->errstr); if ($sql_charset) { # Switch to correct character set local $sql = "set names '$sql_charset'"; local $cmd = $dbh->prepare($sql); if (!$cmd) { &error(&text('esql', "".&html_escape($sql)."", "".&html_escape($dbh->errstr)."")); } if (!$cmd->execute()) { &error(&text('esql', "".&html_escape($sql)."", "".&html_escape($dbh->errstr)."")); } $cmd->finish(); } local $cmd = $dbh->prepare($sql); if (!$cmd) { &error(&text('esql', "".&html_escape($_[1])."", "".&html_escape($dbh->errstr)."")); } if (!$cmd->execute(@params)) { &error(&text('esql', "".&html_escape($_[1])."", "".&html_escape($dbh->errstr)."")); } local (@data, @row); local @titles = @{$cmd->{'NAME'}}; while(@row = $cmd->fetchrow()) { push(@data, [ @row ]); } $cmd->finish(); $dbh->disconnect(); return { 'titles' => \@titles, 'data' => \@data }; } else { # Use the mysql command program local $temp = &transname(); if (@params) { # Sub in ? parameters local $p; local $pos = -1; foreach $p (@params) { $pos = index($sql, '?', $pos+1); &error("Incorrect number of parameters") if ($pos < 0); local $qp = $p; $qp =~ s/'/''/g; $qp = $qp eq '' ? 'NULL' : "'$qp'"; $sql = substr($sql, 0, $pos).$qp.substr($sql, $pos+1); $pos += length($qp)-1; } } open(TEMP, ">$temp"); if ($sql_charset) { print TEMP "set names '$sql_charset';\n"; } print TEMP $sql,"\n"; close(TEMP); open(DBS, "\"$config{'mysql'}\" $authstr -E -t ".quotemeta($_[0])." <$temp 2>&1 |"); local $t = &parse_mysql_vertical(DBS); close(DBS); unlink($temp); if (!ref($t)) { $t =~ s/^ERROR[^:]*://; &error(&text('esql', "".&html_escape($_[1])."", "".&html_escape($t)."")); } return $t; } } # execute_sql_logged(database, command, param, ...) sub execute_sql_logged { &additional_log('sql', $_[0], $_[1]); return &execute_sql(@_); } # parse_mysql_table(handle) # Given a filehandle, parses a text table in the format mysql uses sub parse_mysql_table { local $fh = $_[0]; local ($line, $i, @edge); do { # skip to table top $line = <$fh>; return $line if ($line =~ /^(ERROR|\S*mysqlshow:)/); } while($line && $line !~ /^\+/); for($i=0; $i; # skip first row of -'s local @titles = &parse_mysql_line($line, \@edge); $line = <$fh>; # skip next row of -'s local @data; while(1) { $line = <$fh>; last if (!$line || $line !~ /^\|/); while($line !~ /\|\s+$/) { # Line has a return in it! $line .= <$fh>; } push(@data, [ &parse_mysql_line($line, \@edge) ]); } return { 'titles' => \@titles, 'data' => \@data }; } # parse_mysql_line(line, &edges) sub parse_mysql_line { local @rv; for($i=0; $i<@{$_[1]}-1; $i++) { local $w = substr($_[0], $_[1]->[$i]+1, $_[1]->[$i+1] - $_[1]->[$i] - 2); $w =~ s/^\s//; $w =~ s/\s+$//; $w =~ s/\\/\\\\/g; $w =~ s/\n/\\n/g; push(@rv, $w); } return @rv; } # parse_mysql_vertical(handle) # Parses mysql output in the -E format sub parse_mysql_vertical { local (@data, @titles, $row = -1, $col, %hascol); local $fh = $_[0]; local $line = <$fh>; if (!$line) { # No output at all - must be a non-select return { }; } return $line if ($line =~ /^ERROR/); local $errtxt = &text('eparse', "mysql", "DBI", "DBD::mysql"); while($line) { $line =~ s/\r|\n//g; if ($line =~ /^\*\*\*/) { # A row header $row++; $col = -1; $data[$row] = [ ]; } elsif ($line =~ /^\s*([^:\s]+): (.*)/ && ($row == 0 || $hascol{$1})) { # A new column $col++; $titles[$col] = $1; $row >= 0 || return $errtxt; $data[$row]->[$col] = $2; $hascol{$1}++; } else { # Continuing the last column $row >= 0 || return $errtxt; $data[$row]->[$col] .= "\n".$line; } $line = <$fh>; } return { 'titles' => \@titles, 'data' => \@data }; } sub can_edit_db { if ($module_info{'usermin'}) { foreach $l (split(/\t/, $config{'access'})) { if ($l =~ /^(\S+):\s*(.*)$/ && ($1 eq $remote_user || $1 eq '*')) { local @dbs = split(/\s+/, $2); local $d; foreach $d (@dbs) { $d =~ s/\$REMOTE_USER/$remote_user/g; return 1 if ($d eq '*' || $_[0] =~ /^$d$/); } return 0; } } return 0; } else { local $d; return 1 if ($access{'dbs'} eq '*'); foreach $d (split(/\s+/, $access{'dbs'})) { return 1 if ($d && $d eq $_[0]); } return 0; } } # list_accessible_databases() # Returns a list of databases that the current user may access to. Returns # an empty list if he has all of them. sub list_accessible_databases { if ($module_info{'usermin'}) { # From Usermin list local @rv; foreach $l (split(/\t/, $config{'access'})) { if ($l =~ /^(\S+):\s*(.*)$/ && ($1 eq $remote_user || $1 eq '*')) { push(@rv, split(/\s+/, $2)); } } return @rv; } else { # From Webmin access control list return ( ) if ($access{'dbs'} eq '*'); return split(/\s+/, $access{'dbs'}); } } # split_table(&titles, &checkboxes, &links, &col1, &col2, ...) # Outputs a table that is split into two parts sub split_table { local $mid = int((@{$_[2]}+1) / 2); local ($i, $j); print "\n"; foreach $s ([0, $mid-1], [$mid, @{$_[2]}-1]) { print "\n"; } print "
\n"; # Header local @tds = $_[1] ? ( "width=5" ) : ( ); if ($s->[0] <= $s->[1]) { local @hcols; foreach $t (@{$_[0]}) { push(@hcols, $t); } print &ui_columns_start(\@hcols, 100, 0, \@tds); } for($i=$s->[0]; $i<=$s->[1]; $i++) { local @cols; push(@cols, "$_[3]->[$i]"); for($j=4; $j<@_; $j++) { push(@cols, $_[$j]->[$i]); } if ($_[1]) { print &ui_checked_columns_row(\@cols, \@tds, "d", $_[1]->[$i]); } else { print &ui_columns_row(\@cols, \@tds); } } if ($s->[0] <= $s->[1]) { print &ui_columns_end(); } print "
\n"; } # select_db(db) sub select_db { local $rv; local @dbs = &list_databases(); local $d; if ($access{'perms'} == 2 && $access{'dbs'} ne '*') { # Can only select his own databases $rv = &ui_select("dbs", $_[0], [ grep { &can_edit_db($_) } @dbs ], 1, 0, $_[0] ? 1 : 0); } else { # Can select any databases local $ind = &indexof($_[0],@dbs) >= 0; $rv = &ui_radio("db_def", $_[0] eq '%' || $_[0] eq '' ? 1 : $ind ? 2 : 0, [ [ 1, $text{'host_any'} ], [ 2, $text{'host_sel'}." ". &ui_select("dbs", $_[0], \@dbs) ], [ 0, $text{'host_otherdb'}." ". &ui_textbox("db", $_[0] eq '%' || $_[0] eq '' || $ind ? '' : $_[0], 30) ] ]); } return $rv; } sub quote_table { return "estr($_[0]); } # quotestr(string) sub quotestr { local $rv = $_[0]; if (&supports_quoting()) { return "`$rv`"; } else { return $rv; } } # escapestr(string) # Returns a string with quotes escaped, for use in SQL sub escapestr { local $rv = $_[0]; $rv =~ s/'/''/g; return $rv; } # supports_quoting() # Returns 1 if running mysql version 3.23.6 or later sub supports_quoting { if ($mysql_version =~ /^(\d+)\.(\d+)\.(\d+)$/ && ($1 > 3 || ($1 == 3 && $2 > 23) || ($1 == 3 && $2 == 23 && $3 >= 6))) { return 1; } elsif ($mysql_version > 4) { return 1; } else { return 0; } } # supports_routines() # Returns 1 if mysqldump supports routines sub supports_routines { local $out = &backquote_command("$config{'mysqldump'} --help 2>&1 = 0) { # Has information_schema DB .. but does it have views? local @ist = &list_tables("information_schema", 1, 1); if (&indexoflc("views", @ist) >= 0) { $supports_views_cache = 1; } else { $supports_views_cache = 0; } } else { $supports_views_cache = 0; } } } return $supports_views_cache; } # supports_variables() # Returns 1 if running mysql version 4.0.3 or later sub supports_variables { if ($mysql_version =~ /^(\d+)\.(\d+)\.(\d+)$/ && ($1 > 4 || ($1 == 4 && $2 > 0) || ($1 == 4 && $2 == 0 && $3 >= 3))) { return 1; } elsif ($mysql_version > 4) { return 1; } else { return 0; } } # supports_env_pass() # Returns 1 if passing the password via an environment variable is supported sub supports_env_pass { if ($mysql_version >= 4.1 && !$config{'nopwd'}) { # Theortically possible .. but don't do this if ~/.my.cnf contains # a [client] block with password= in it my @uinfo = getpwuid($<); foreach my $cf ($config{'my_cnf'}, "$uinfo[7]/.my.cnf", "$ENV{'HOME'}/.my.cnf") { next if (!$cf || !-r $cf); local @cf = &parse_mysql_config($cf); local $client = &find("client", \@cf); next if (!$client); local $password = &find("password", $client->{'members'}); return 0 if ($password ne ''); } return 1; } return 0; } # working_env_pass() # Returns 1 if MYSQL_PWD can be used to pass the password to mysql sub working_env_pass { return 1 if (!&supports_env_pass()); # Not even used local $config{'nodbi'} = 1; local $data; local $main::error_must_die = 1; eval { $data = &execute_sql_safe(undef, "select version()") }; return $@ || !$data ? 0 : 1; } # user_priv_cols() # Returns the number of columns used for privileges in the user table sub user_priv_cols { if (!$user_priv_cols) { local @str = &table_structure("mysql", "user"); local $s; foreach $s (@str) { $user_priv_cols++ if ($s->{'field'} =~ /_priv/i); } } return $user_priv_cols; } # db_priv_cols() # Returns the number of columns used for privileges in the db table sub db_priv_cols { if (!$db_priv_cols) { local @str = &table_structure("mysql", "db"); local $s; foreach $s (@str) { $db_priv_cols++ if ($s->{'field'} =~ /_priv/i); } } return $db_priv_cols; } # host_priv_cols() # Returns the number of columns used for privileges in the db table sub host_priv_cols { if (!$host_priv_cols) { local @str = &table_structure("mysql", "host"); local $s; foreach $s (@str) { $host_priv_cols++ if ($s->{'field'} =~ /_priv/i); } } return $host_priv_cols; } sub is_blob { return $_[0]->{'type'} =~ /(text|blob)$/i; } # get_mysql_version(&out) # Returns a version number, undef if one cannot be found, or -1 for a .so # problem sub get_mysql_version { local $out = &backquote_command("\"$config{'mysql'}\" -V 2>&1"); ${$_[0]} = $out if ($_[0]); if ($out =~ /lib\S+\.so/) { return -1; } elsif ($out =~ /distrib\s+((3|4|5|6)\.[0-9\.]*)/i) { return $1; } else { return undef; } } # date_subs(filename) # Does strftime-style date substitutions on a filename, if enabled sub date_subs { if ($config{'date_subs'}) { eval "use POSIX"; eval "use posix" if ($@); local @tm = localtime(time()); &clear_time_locale(); local $rv = strftime($_[0], @tm); &reset_time_locale(); return $rv; } else { return $_[0]; } } # execute_before(db, handle, escape, path, db-for-config) # Executes the before-backup command for some DB, and sends output to the # given file handle. Returns 1 if the command suceeds, or 0 on failure sub execute_before { local $cmd = $config{'backup_before_'.$_[4]}; if ($cmd) { $ENV{'BACKUP_FILE'} = $_[3]; local $h = $_[1]; local $out; local $rv = &execute_command($cmd, undef, \$out, \$out); if ($h && $out) { print $h $_[2] ? "

".&html_escape($out)."
" : $out; } return !$rv; } return 1; } # execute_after(db, handle, escape, path, db-for-config) sub execute_after { local $cmd = $config{'backup_after_'.$_[4]}; if ($cmd) { $ENV{'BACKUP_FILE'} = $_[3]; local $h = $_[1]; local $out; local $rv = &execute_command($cmd, undef, \$out, \$out); if ($h && $out) { print $h $_[2] ? "
".&html_escape($out)."
" : $out; } return !$rv; } return 1; } # show_table_form(count) sub show_table_form { print &ui_columns_start([ $text{'field_name'}, $text{'field_type'}, $text{'field_size'}, $text{'table_nkey'}, $text{'field_auto'}, $text{'field_null'}, $text{'field_unsigned'}, $text{'field_default'} ]); local $i; for($i=0; $i<$_[0]; $i++) { local @cols; push(@cols, &ui_textbox("field_$i", undef, 20)); push(@cols, &ui_select("type_$i", "", [ "", @type_list ])); push(@cols, &ui_textbox("size_$i", undef, 10)); push(@cols, &ui_checkbox("key_$i", 1, $text{'yes'}, 0)); push(@cols, &ui_checkbox("auto_$i", 1, $text{'yes'}, 0)); push(@cols, &ui_checkbox("null_$i", 1, $text{'yes'}, 1)); push(@cols, &ui_checkbox("unsigned_$i", 1, $text{'yes'}, 0)); push(@cols, &ui_textbox("default_$i", undef, 20)); print &ui_columns_row(\@cols); } print &ui_columns_end(); } # parse_table_form(&extrafields, tablename) sub parse_table_form { local @fields = @{$_[0]}; local $i; local (@auto, @pri); for($i=0; defined($in{"field_$i"}); $i++) { next if (!$in{"field_$i"}); $in{"field_$i"} =~ /^\S+$/ || &error(&text('table_efield', $in{"field_$i"})); $in{"type_$i"} || &error(&text('table_etype', $in{"field_$i"})); if ($in{"type_$i"} eq 'enum' || $in{"type_$i"} eq 'set') { local @ev = split(/\s+/, $in{"size_$i"}); @ev || &error(&text('table_eenum', $in{"type_$i"}, $in{"field_$i"})); $in{"size_$i"} = join(",", map { "'$_'" } @ev); } if ($in{"size_$i"}) { push(@fields, sprintf "%s %s(%s)", "estr($in{"field_$i"}), $in{"type_$i"},$in{"size_$i"}); } else { push(@fields, sprintf "%s %s", "estr($in{"field_$i"}), $in{"type_$i"}); } if ($in{"unsigned_$i"}) { $fields[@fields-1] .= " unsigned"; } if (!$in{"null_$i"}) { $fields[@fields-1] .= " not null"; } if ($in{"key_$i"}) { $in{"null_$i"} && &error(&text('table_epnull',$in{"field_$i"})); push(@pri, $in{"field_$i"}); } if ($in{"auto_$i"}) { push(@auto, $fields[@fields-1]); push(@autokey, $in{"key_$i"}); } if ($in{"default_$i"}) { $fields[@fields-1] .= " default '".$in{"default_$i"}."'"; } } @auto < 2 || &error($text{'table_eauto'}); @fields || &error($text{'table_enone'}); local @sql; local $sql = "create table "."estr($_[1])." (".join(",", @fields).")"; $sql .= " type = $in{'type'}" if ($in{'type'}); push(@sql, $sql); if (@pri) { # Setup primary fields too push(@sql, "alter table "."estr($_[1])." add primary key (". join(",", map { "estr($_) } @pri).")"); } if (@auto) { # Make field auto-increment push(@sql, "alter table "."estr($_[1]). " modify $auto[0] auto_increment ". ($autokey[0] ? "" : "unique")); } return @sql; } # execute_sql_file(database, file, [user, pass], [unix-user]) # Executes some file of SQL commands, and returns the exit status and output sub execute_sql_file { if (&is_readonly_mode()) { return (0, undef); } local ($db, $file, $user, $pass) = @_; local $authstr = &make_authstr($user, $pass); local $cmd = "$config{'mysql'} $authstr -t ".quotemeta($db)." <".quotemeta($file); -r $file || return (1, "$file does not exist"); if ($_[4] && $_[4] ne 'root' && $< == 0) { # Restoring as a Unix user $cmd = &command_as_user($_[4], 0, $cmd); } local $out = &backquote_logged("$cmd 2>&1"); local @rv = ($?, $? ? $out || "$cmd failed" : $out); &make_authstr(); # Put back old password environment variable return @rv; } # start_mysql() # Starts the MySQL database server, and returns undef on success or an # error message on failure. sub start_mysql { local $temp = &transname(); local $rv = &system_logged("($config{'start_cmd'}) >$temp 2>&1"); local $out = `cat $temp`; unlink($temp); if ($rv || $out =~ /failed/i) { return "
$out
"; } return undef; } # stop_mysql() # Halts the MySQL database server, and returns undef on success or an # error message on failure. sub stop_mysql { local $out; if ($config{'stop_cmd'}) { $out = &backquote_logged("$config{'stop_cmd'} 2>&1"); } else { $out = &backquote_logged("$config{'mysqladmin'} $authstr shutdown 2>&1"); } if ($? || $out =~ /failed/i) { return "
$out
"; } return undef; } # split_enum(type) # Returns a list of allowed values for an enum sub split_enum { local ($type) = @_; if ($type =~ /^(enum|set)\((.*)\)$/) { $type = $2; } local $esize = $type; local @ev; while($esize =~ /^'([^']*)'(,?)(.*)$/) { push(@ev, $1); $esize = $3; } return @ev; } # Returns 1 if the mysql server being managed is on this system sub is_mysql_local { return $config{'host'} eq '' || $config{'host'} eq 'localhost' || $config{'host'} eq &get_system_hostname() || &to_ipaddress($config{'host'}) eq &to_ipaddress(&get_system_hostname()); } # get_mysql_config() # Returns the parsed my.cnf file sub get_mysql_config { if (!defined(@mysql_config_cache)) { if (!-r $config{'my_cnf'}) { return undef; } @mysql_config_cache = &parse_mysql_config($config{'my_cnf'}); } return \@mysql_config_cache; } # parse_mysql_config(file) # Reads one MySQL config file sub parse_mysql_config { local ($file) = @_; local @rv; local $sect; local $lnum = 0; local $lref = &read_file_lines($file, 1); local $_; foreach (@$lref) { s/\r|\n//g; s/#.*$//; s/\s+$//; if (/^\s*\[(\S+)\]$/) { # Start of a section $sect = { 'name' => $1, 'members' => [ ], 'file' => $file, 'line' => $lnum, 'eline' => $lnum }; push(@rv, $sect); } elsif (/^\s*(\S+)\s*=\s*(.*)$/ && $sect) { # Variable in a section push(@{$sect->{'members'}}, { 'name' => $1, 'value' => $2, 'file' => $file, 'line' => $lnum }); $sect->{'eline'} = $lnum; } elsif (/^\s*(\S+)$/ && $sect) { # Single directive in a section push(@{$sect->{'members'}}, { 'name' => $1, 'file' => $file, 'line' => $lnum }); $sect->{'eline'} = $lnum; } $lnum++; } return @rv; } # find(name, &conf) sub find { local ($name, $conf) = @_; local @rv = grep { lc($_->{'name'}) eq lc($name) } @$conf; return wantarray ? @rv : $rv[0]; } # find_value(name, &conf) sub find_value { local ($name, $conf) = @_; local @rv = map { $_->{'value'} } &find($name, $conf); return wantarray ? @rv : $rv[0]; } # save_directive(&conf, §ion, name, &values) # Updates one or multiple lines in a my.cnf section sub save_directive { local ($conf, $sect, $name, $values) = @_; local @old = &find($name, $sect->{'members'}); local $lref = &read_file_lines($config{'my_cnf'}); for(my $i=0; $i<@old || $i<@$values; $i++) { local $old = $old[$i]; local $line = $values->[$i] eq "" ? $name : "$name = $values->[$i]"; if ($old && defined($values->[$i])) { # Updating $lref->[$old->{'line'}] = $line; $old->{'value'} = $values->[$i]; } elsif (!$old && defined($values->[$i])) { # Adding splice(@$lref, $sect->{'eline'}+1, 0, $line); &renumber($conf, $sect->{'eline'}, 1); push(@{$sect->{'members'}}, { 'name' => $name, 'value' => $values->[$i], 'line' => $sect->{'eline'}+1 }); } elsif ($old && !defined($values->[$i])) { # Deleting splice(@$lref, $old->{'line'}, 1); &renumber($conf, $old->{'line'}, -1); @{$sect->{'members'}} = grep { $_ ne $old } @{$sect->{'members'}}; } } } sub renumber { local ($conf, $line, $offset) = @_; foreach my $sect (@$conf) { $sect->{'line'} += $offset if ($sect->{'line'} >= $line); $sect->{'eline'} += $offset if ($sect->{'eline'} >= $line); foreach my $m (@{$sect->{'members'}}) { $m->{'line'} += $offset if ($m->{'line'} >= $line); } } } # parse_set_variables(value, ...) # Returns a hash of variable mappings sub parse_set_variables { local %vars; foreach my $v (@_) { if ($v =~ /^(\S+)=(\S+)$/) { $vars{$1} = $2; } } return %vars; } sub mysql_size_input { local ($name, $value) = @_; local $units; if ($value =~ /^(\d+)([a-z])$/i) { $value = $1; $units = $2; } $units = "" if ($units eq "b"); return &ui_textbox($name, $value, 8)."\n". &ui_select($name."_units", $units, [ [ "", "bytes" ], [ "K", "kB" ], [ "M", "MB" ], [ "G", "GB" ] ]); } # list_indexes(db) # Returns the names of all indexes in some database sub list_indexes { local ($db) = @_; local (@rv, $r); foreach my $table (&list_tables($db)) { local $s = &execute_sql_safe($db, "show index from "."estr($table)); local (%tp, $i); for($i=0; $i<@{$s->{'titles'}}; $i++) { $tp{lc($s->{'titles'}->[$i])} = $i; } foreach $r (@{$s->{'data'}}) { if ($r->[$tp{'key_name'}] ne 'PRIMARY') { push(@rv, $r->[$tp{'key_name'}]); } } } return &unique(@rv); } # index_structure(db, indexname) # Returns information on an index sub index_structure { local ($db, $index) = @_; local (@rv, $r); local $info; foreach my $table (&list_tables($db)) { local $s = &execute_sql_safe($db, "show index from "."estr($table)); local (%tp, $i); for($i=0; $i<@{$s->{'titles'}}; $i++) { $tp{lc($s->{'titles'}->[$i])} = $i; } foreach $r (@{$s->{'data'}}) { if ($r->[$tp{'key_name'}] eq $index) { # Found some info $info->{'table'} = $r->[$tp{'table'}]; $info->{'name'} = $index; $info->{'type'} = lc($r->[$tp{'index_type'}]) || lc($r->[$tp{'comment'}]); push(@{$info->{'cols'}}, $r->[$tp{'column_name'}]); } } } return $info; } # list_views(db) # Returns the names of all views in some database sub list_views { local ($db) = @_; local @rv; local $d = &execute_sql($db, "select table_schema,table_name from information_schema.views where table_schema = ?", $db); foreach $r (@{$d->{'data'}}) { push(@rv, $r->[1]); } return @rv; } # view_structure(db, viewname) # Returns information about a view sub view_structure { local ($db, $view) = @_; local $info = { 'name' => $view }; local $d = &execute_sql($db, "show create view $view"); local $c = $d->{'data'}->[0]->[1]; if ($c =~ /algorithm\s*=\s*(\S+)/i) { $info->{'algorithm'} = lc($1); } if ($c =~ /definer\s*=\s*`(\S+)`\@`(\S+)`/i) { $info->{'definer'} = "$1\@$2"; } elsif ($c =~ /definer\s*=\s*(\S+)/i) { $info->{'definer'} = $1; } if ($c =~ /sql\s+security\s+(\S+)/i) { $info->{'security'} = lc($1); } if ($c =~ s/\s+with\s+(cascaded|local)\s+check\s+option//i) { $info->{'check'} = lc($1); } if ($c =~ /view\s+(`\S+`|\S+)\s+as\s+(.*)/i) { $info->{'query'} = $2; } return $info; } # list_character_sets([db]) # Returns a list of supported character sets. Each row is an array ref of # a code and name sub list_character_sets { local @rv; local $db = $_[0] || $master_db; if ($mysql_version < 4.1) { local $d = &execute_sql($db, "show variables like 'character_sets'"); @rv = map { [ $_, $_ ] } split(/\s+/, $d->{'data'}->[0]->[1]); } else { local $d = &execute_sql($db, "show character set"); @rv = map { [ $_->[0], $_->[1] ] } @{$d->{'data'}}; } return sort { lc($a) cmp lc($b) } @rv; } # list_system_variables() # Returns a list of all system variables, and their default values sub list_system_variables { local $mysqld = $config{'mysqld'}; if (!$mysqld) { # Mysqld path not in config .. guess from mysql path $mysqld = $config{'mysql'}; $mysqld =~ s/mysql$/mysqld/g; $mysqld =~ s/bin/sbin/g; if (!-x $mysqld) { $mysqld = $config{'mysql'}; $mysqld =~ s/mysql$/mysqld/g; $mysqld =~ s/bin/libexec/g; if (!-x $mysqld) { # Look in Webmin path &error($mysqld); $mysqld = &has_command("mysqld"); } } } return ( ) if (!$mysqld); # Read supported variables local @rv; &open_execute_command(MYSQLD, "$mysqld --verbose --help", 1, 1); while() { s/\r|\n//g; if (/^(\S+)\s+current\s+value:\s+(\S*)/) { push(@rv, [ $1, $2 ]); } elsif (/^\-\-\-\-/) { $started = 1; } elsif ($started && /^(\S+)\s+(.*)/) { push(@rv, [ $1, $2 eq "(No default value)" ? undef : $2 ]); } } close(MYSQL); return @rv; } # list_compatible_formats() # Returns a list of two-element arrays, containing compatability format # codes and descriptions sub list_compatible_formats { return map { [ $_, $text{'compat_'.$_} ] } ( "ansi", "mysql323", "mysql40", "postgresql", "oracle", "mssql", "db2", "maxdb" ); } # list_compatible_options() # Returns a list of two-element arrays, containing compatability options sub list_compatible_options { return map { [ $_, $text{'compat_'.$_} ] } ( "no_key_options", "no_table_options", "no_field_options" ); } # compression_format(file) # Returns 0 if uncompressed, 1 for gzip, 2 for compress, 3 for bzip2 or # 4 for zip sub compression_format { open(BACKUP, $_[0]); local $two; read(BACKUP, $two, 2); close(BACKUP); return $two eq "\037\213" ? 1 : $two eq "\037\235" ? 2 : $two eq "PK" ? 4 : $two eq "BZ" ? 3 : 0; } # backup_database(db, dest-file, compress-mode, drop-flag, where-clause, # charset, &compatible, &only-tables, run-as-user) # Backs up a database to the given file, optionally with compression. Returns # undef on success, or an error message on failure. sub backup_database { local ($db, $file, $compress, $drop, $where, $charset, $compatible, $tables, $user) = @_; if ($compress == 0) { $writer = ">$file"; } elsif ($compress == 1) { $writer = "| gzip -c >$file"; } elsif ($compress == 2) { $writer = "| bzip2 -c >$file"; } local $dropsql = $drop ? "--add-drop-table" : ""; local $wheresql = $where ? "\"--where=$in{'where'}\"" : ""; local $charsetsql = $charset ? "--default-character-set=".quotemeta($charset) : ""; local $compatiblesql = @$compatible ? "--compatible=".join(",", @$compatible) : ""; local $quotingsql = &supports_quoting() ? "--quote-names" : ""; local $routinessql = &supports_routines() ? "--routines" : ""; local $tablessql = join(" ", map { quotemeta($_) } @$tables); local $cmd = "$config{'mysqldump'} $authstr $dropsql $wheresql $charsetsql $compatiblesql $quotingsql $routinessql ".quotemeta($db)." $tablessql 2>&1 $writer"; if ($user && $user ne "root") { $cmd = &command_as_user($user, undef, $cmd); } local $out = &backquote_logged("($cmd) 2>&1"); if ($? || $out) { return $out; } return undef; } 1; mysql/table_form.cgi0000755000567100000120000000304011220734044014476 0ustar jcameronwheel#!/usr/local/bin/perl # table_form.cgi # Display a form for creating a table require './mysql-lib.pl'; &ReadParse(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); &ui_print_header(undef, $text{'table_title2'}, "", "table_form"); print &ui_form_start("create_table.cgi", "post"); print &ui_hidden("db", $in{'db'}),"\n"; print &ui_table_start($text{'table_header2'}, undef, 2); print &ui_table_row($text{'table_name'}, &ui_textbox("name", undef, 30)); @dbs = grep { &can_edit_db($_) } &list_databases(); if (@dbs > $max_dbs) { # Enter source table name manually print &ui_table_row($text{'table_copy2'}, &ui_select("copydb", $in{'db'}, \@dbs). " $text{'table_copy2t'} ". &ui_textbox("copytable", undef, 20)); } else { # Show all tables in all DBs foreach $d (@dbs) { foreach $t (&list_tables($d, 1)) { push(@tables, [ "$d.$t" ]); } } print &ui_table_row($text{'table_copy'}, &ui_select("copy", undef, [ [ "", $text{'table_copynone'} ], @tables ])); } print &ui_table_row($text{'table_type'}, &ui_select("type", "", [ [ "", $text{'default'} ], [ "isam" ], [ "myisam" ], [ "heap" ], [ "merge" ], [ "innodb" ], [ "ndbcluster" ] ])); $out = &capture_function_output(\&show_table_form, $in{"fields"} || 4); print &ui_table_row(undef, $out, 2); print &ui_table_end(); print &ui_form_end([ [ "create", $text{'create'} ] ]); &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); mysql/config-netbsd0000644000567100000120000000063311220734044014347 0ustar jcameronwheelstart_cmd=(/usr/pkg/bin/safe_mysqld || /usr/pkg/bin/mysqld_safe) & perpage=25 mysql=/usr/pkg/bin/mysql mysqldump=/usr/pkg/bin/mysqldump mysqlimport=/usr/pkg/bin/mysqlimport mysqlshow=/usr/pkg/bin/mysqlshow login=root mysql_libs=/usr/pkg/lib/mysql mysqladmin=/usr/pkg/bin/mysqladmin style=0 add_mode=1 nodbi=0 access=*: * blob_mode=0 date_subs=0 passwd_mode=0 max_dbs=50 my_cnf=/etc/my.cnf max_text=1000 nopwd=0 mysql/edit_index.cgi0000775000567100000120000000345711220734044014516 0ustar jcameronwheel#!/usr/local/bin/perl # Show a form for creating or editing index on a table require './mysql-lib.pl'; &ReadParse(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); $access{'indexes'} || &error($text{'index_ecannot'}); if ($in{'index'}) { # Editing an index $str = &index_structure($in{'db'}, $in{'index'}); $table = $str->{'table'}; } else { # Creating an index $table = $in{'table'}; } $desc = &text('table_header', "$table", "$in{'db'}"); &ui_print_header($desc, $in{'index'} ? $text{'index_title2'} : $text{'index_title1'}, ""); print &ui_form_start("save_index.cgi", "post"); print &ui_hidden("db", $in{'db'}),"\n"; print &ui_hidden("table", $table),"\n"; print &ui_hidden("old", $in{'index'}),"\n"; print &ui_table_start($text{'index_header1'}, undef, 2); # Index name print &ui_table_row($text{'index_name'}, &ui_textbox("name", $str->{'name'}, 20)); # Fields in index @str = &table_structure($in{'db'}, $table); @cols = map { $_->{'field'} } @str; print &ui_table_row($text{'index_fields'}, &ui_select("cols", $str->{'cols'}, [ map { [ $_->{'field'}, "$_->{'field'} - $_->{'type'}" ] } @str ], 5, 1)); # Index type print &ui_table_row($text{'index_type'}, &ui_select("type", $str->{'type'}, [ !$in{'index'} ? ( [ "", "<$text{'default'}>" ] ) : ( ), [ "unique", $text{'index_unique'} ], [ "fulltext", $text{'index_fulltext'} ], [ "spatial", $text{'index_spatial'} ] ])); print &ui_table_end(); if ($in{'index'}) { print &ui_form_end([ [ "save", $text{'save'} ], [ "delete", $text{'delete'} ] ]); } else { print &ui_form_end([ [ "create", $text{'create'} ] ]); } &ui_print_footer("edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); mysql/edit_field.cgi0000755000567100000120000001147711220734044014471 0ustar jcameronwheel#!/usr/local/bin/perl # edit_field.cgi # Display a form for editing an existing field or creating a new one require './mysql-lib.pl'; &ReadParse(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); $desc = &text('field_in', "$in{'table'}", "$in{'db'}"); if ($in{'type'}) { # Creating a new field &ui_print_header($desc, $text{'field_title1'}, "", "create_field"); $type = $in{'type'}; } else { # Editing an existing field &ui_print_header($desc, $text{'field_title2'}, "", "edit_field"); @desc = &table_structure($in{'db'}, $in{'table'}); $f = $desc[$in{'idx'}]; $type = $f->{'type'}; } # Start of form print &ui_form_start("save_field.cgi"); print &ui_hidden("db", $in{'db'}); print &ui_hidden("table", $in{'table'}); print &ui_hidden("new", $in{'type'}); print &ui_table_start($text{'field_header'}, undef, 2); # Field name print &ui_table_row($text{'field_name'}, &ui_textbox("field", $f->{'field'}, 20)); print &ui_hidden("old", $f->{'field'}) if (!$in{'type'}); # Type if ($type =~ /^(\S+)\((.*)\)(.*)/) { $type = $1; $size = $2; $extra = $3; } print &ui_hidden("type", $type); if ($in{'type'}) { # New field .. just show chosen type $tsel = $type; } else { # Existing field .. allow type change $tsel = &ui_select("newtype", $type, \@type_list)." ". $text{'field_typewarn'}; } print &ui_table_row($text{'field_type'}, $tsel); if ($type eq 'enum' || $type eq 'set') { # List of values local @ev = &split_enum($size); print &ui_table_row($text{'field_enum'}, &ui_textarea("size", join("\n", @ev), 4, 20)); } elsif ($type eq 'float' || $type eq 'double' || $type eq 'decimal') { # Two values, for total and decimal print &ui_table_row($text{'field_dual'}, &ui_textbox("size1", $size =~ /^(\d+)/ ? $1 : '', 5)."\n". &ui_textbox("size2", $size =~ /(\d+)$/ ? $1 : '', 5)); } elsif ($type eq 'date' || $type eq 'datetime' || $type eq 'time' || $type eq 'timestamp' || $type =~ /(blob|text)$/) { # No width! } elsif ($type ne 'varchar' && $type ne 'char' && $in{'type'}) { # Size is optional for new fields of most types print &ui_table_row($text{'field_size'}, &ui_opt_textbox("size", undef, 10, $text{'default'})); } else { # Size is one value print &ui_table_row($text{'field_size'}, &ui_textbox("size", $size, 10)); } if ($type =~ /int$/) { # Display unsigned/zerofill option print &ui_table_row($text{'field_opts'}, &ui_radio("opts", $extra =~ /unsigned/ ? 'unsigned' : $extra =~ /zerofill/ ? 'zerofill' : '', [ [ '', $text{'field_none'} ], [ 'unsigned', $text{'field_unsigned'} ], [ 'zerofill', $text{'field_zerofill'} ] ])); # Display auto-increment option print &ui_table_row($text{'field_auto'}, &ui_radio("ext", $f->{'extra'} =~ /auto_increment/ ? 'auto_increment' : '', [ [ 'auto_increment', $text{'yes'} ], [ '', $text{'no'} ] ])); } elsif ($type eq 'float' || $type eq 'double' || $type eq 'decimal') { # Display zerofill option print &ui_table_row($text{'field_opts'}, &ui_radio("opts", $extra =~ /zerofill/ ? 'zerofill' : '', [ [ '', $text{'field_none'} ], [ 'zerofill', $text{'field_zerofill'} ] ])); } elsif ($type eq 'char' || $type eq 'varchar') { # Display binary option print &ui_table_row($text{'field_opts'}, &ui_radio("opts", $extra =~ /binary/ ? 'binary' : '', [ [ '', $text{'field_ascii'} ], [ 'binary', $text{'field_binary'} ] ])); } # Allow nulls? print &ui_table_row($text{'field_null'}, &ui_radio("null", $in{'type'} || $f->{'null'} eq 'YES' ? 1 : 0, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])); # Default value $defmode = $f->{'default'} eq 'NULL' || !defined($f->{'default'}) ? 0 : $f->{'default'} eq 'CURRENT_TIMESTAMP' ? 2 : $f->{'default'} eq '' ? 3 : 1; @defs = ( [ 0, 'NULL' ] ); if ($in{'type'}) { # Let MySQL decide push(@defs, [ 3, $text{'field_defdef'} ]); } elsif ($type eq 'char' || $type eq 'varchar') { # Empty string push(@defs, [ 3, $text{'field_defempty'} ]); } if ($type eq "timestamp") { push(@defs, [ 2, $text{'field_current'} ]); } push(@defs, [ 1, $text{'field_defval'}." ". &ui_textbox("default", $defmode == 1 ? $f->{'default'} : "", 40) ]); print &ui_table_row($text{'field_default'}, &ui_radio("default_def", $defmode, \@defs)); # Part of primary key print &ui_table_row($text{'field_key'}, &ui_yesno_radio("key", $f->{'key'} eq 'PRI' ? 1 : 0)); print &ui_hidden("oldkey", $f->{'key'} eq 'PRI' ? 1 : 0); print &ui_table_end(); if ($in{'type'}) { print &ui_form_end([ [ undef, $text{'create'} ] ]); } else { print &ui_form_end([ [ undef, $text{'save'} ], @desc > 1 ? ( [ 'delete', $text{'delete'} ] ): ( ) ]); } &ui_print_footer("edit_table.cgi?db=$in{'db'}&table=".&urlize($in{'table'}), $text{'table_return'}, "edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, "", $text{'index_return'}); mysql/save_field.cgi0000755000567100000120000001106411220734044014472 0ustar jcameronwheel#!/usr/local/bin/perl # save_field.cgi # Create, modify or delete a field require './mysql-lib.pl'; &ReadParse(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); &error_setup($text{'field_err'}); # Build default clause if ($in{'default_def'} == 0) { $default = "default NULL"; } elsif ($in{'default_def'} == 2) { $default = "default CURRENT_TIMESTAMP"; } elsif ($in{'default_def'} == 3) { $default = $in{'new'} ? "" : "default ''"; } else { $default = "default '$in{'default'}'"; } if ($in{'delete'}) { # delete this field &execute_sql_logged($in{'db'}, "alter table "."estr($in{'table'})." drop ". "estr($in{'old'})); &webmin_log("delete", "field", $in{'old'}, \%in); } elsif ($in{'new'}) { # add a new field $in{'field'} =~ /^\S+$/ || &error(&text('field_efield', $in{'field'})); $in{'null'} && $in{'key'} && &error($text{'field_ekey'}); $in{'size'} = $size = &validate_size(); $sql = sprintf "alter table %s add %s %s%s %s %s %s", "estr($in{'table'}), "estr($in{'field'}), $in{'type'}, $size, $in{'null'} ? '' : 'not null', $default, $in{'ext'}; &execute_sql_logged($in{'db'}, $sql); &webmin_log("create", "field", $in{'field'}, \%in); } else { # modify an existing field $in{'field'} =~ /^\S+$/ || &error(&text('field_efield', $in{'field'})); $in{'null'} && $in{'key'} && &error($text{'field_ekey'}); $in{'size'} = $size = &validate_size(); $sql = sprintf "alter table %s modify %s %s%s %s %s %s", "estr($in{'table'}), "estr($in{'old'}), $in{'type'}, $size, $in{'null'} ? 'null' : 'not null', $default, $in{'ext'}; &execute_sql_logged($in{'db'}, $sql); if ($in{'old'} ne $in{'field'} || $in{'type'} ne $in{'newtype'}) { # Rename or retype field as well if ($in{'type'} ne $in{'newtype'}) { # Type has changed .. fix size if ($in{'newtype'} eq 'enum' || $in{'newtype'} eq 'set') { # Convert old size to enum values if ($in{'type'} ne 'enum' && $in{'type'} ne 'set') { $size = $size =~ /^\((.*)\)/ ? '('.join(",", map { "'$_'" } split(/\n/, $1)).')' : "('')"; } } elsif ($in{'newtype'} eq 'float' || $in{'newtype'} eq 'double' || $in{'newtype'} eq 'decimal') { # Use old sizes or size and opts $size = $size =~ /^\((\d+),(\d+)\)/ ? $size : $size =~ /^\((\d+)\)(.*)/ ? "($1,$1)$2" : ""; } elsif ($in{'newtype'} eq 'date' || $in{'newtype'} eq 'datetime' || $in{'newtype'} eq 'time' || $in{'newtype'} =~ /(blob|text)$/) { # New type has no size or opts $size = ""; } else { # Use old size and opts $size = $size =~ /^\((\d+)/ ? "($1) $in{'opts'}" : $in{'newtype'} =~ /char$/ ? "(255) $in{'opts'}" : $in{'opts'}; } } $sql = sprintf "alter table %s change %s %s %s%s %s", "estr($in{'table'}), "estr($in{'old'}), "estr($in{'field'}), $in{'newtype'}, $size, $in{'null'} ? '' : 'not null'; &execute_sql_logged($in{'db'}, $sql); } &webmin_log("modify", "field", $in{'field'}, \%in); } if ($in{'key'} != $in{'oldkey'}) { # Adding or removing a primary key to the table foreach $d (&table_structure($in{'db'}, $in{'table'})) { push(@pri, $d->{'field'}) if ($d->{'key'} eq 'PRI'); } if ($in{'key'}) { @npri = ( @pri, $in{'field'} ); } else { @npri = grep { $_ ne $in{'field'} } @pri; } &execute_sql_logged($in{'db'}, "alter table "."estr($in{'table'})." drop primary key") if (@pri); &execute_sql_logged($in{'db'}, "alter table "."estr($in{'table'})." add primary key (". join(",", map { "estr($_) } @npri).")") if (@npri); } &redirect("edit_table.cgi?db=$in{'db'}&table=".&urlize($in{'table'})); sub validate_size { if ($in{'type'} eq 'enum' || $in{'type'} eq 'set') { $in{'size'} || &error($text{'field_eenum'}); $in{'size'} =~ s/\r//g; return '('.join(",", map { "'$_'" } split(/\n/, $in{'size'})).')'; } elsif ($in{'type'} eq 'float' || $in{'type'} eq 'double' || $in{'type'} eq 'decimal') { $in{'size1'} =~ /^\d+$/ || &error(&text('field_esize', $in{'size1'})); $in{'size2'} =~ /^\d+$/ || &error(&text('field_esize', $in{'size2'})); return "($in{'size1'},$in{'size2'}) $in{'opts'}"; } elsif ($in{'type'} eq 'date' || $in{'type'} eq 'datetime' || $in{'type'} eq 'time' || $in{'type'} eq 'timestamp' || $in{'type'} =~ /(blob|text)$/) { return ""; } elsif ($in{'size_def'}) { return ""; } else { $in{'size'} =~ /^\d+$/ || &error(&text('field_esize', $in{'size'})); return "($in{'size'}) $in{'opts'}"; } } mysql/newdb_form.cgi0000755000567100000120000000206011220734044014507 0ustar jcameronwheel#!/usr/local/bin/perl # newdb_form.cgi # Display a form for creating a new database require './mysql-lib.pl'; $access{'create'} || &error($text{'newdb_ecannot'}); &ui_print_header(undef, $text{'newdb_title'}, "", "newdb_form"); print &ui_form_start("newdb.cgi", "post"); print &ui_table_start($text{'newdb_header'}, undef, 2); # DB name print &ui_table_row($text{'newdb_db'}, &ui_textbox("db", undef, 20)); if ($mysql_version >= 4.1) { # Character set option print &ui_table_row($text{'newdb_charset'}, &ui_select("charset", undef, [ [ undef, "<$text{'default'}>" ], &list_character_sets() ])); } # Initial table name print &ui_table_row($text{'newdb_table'}, &ui_radio("table_def", 1, [ [ 1, $text{'newdb_none'} ], [ 0, $text{'newdb_tname'} ] ])." ". &ui_textbox("table", undef, 20)." ".$text{'newdb_str'}."..."); $out = &capture_function_output(\&show_table_form, 4); print &ui_table_row(undef, $out, 2); print &ui_table_end(); print &ui_form_end([ [ undef, $text{'create'} ] ]); &ui_print_footer("", $text{'index_return'}); mysql/config.info.de0000644000567100000120000000201211220734044014404 0ustar jcameronwheeladd_mode=Benutze vertikale Reihen als Bearbeitungs-Schnittstelle,1,1-Ja,0-Nein blob_mode=Zeige Blob- und Textfelder als,1,0-Daten in der Tabelle,1-Zu downloadende Verbindungen date_subs=Verwende strftime als Ersatz der Backup-Speicherorte?,1,1-Ja,0-Nein host=Verbinde zu MySQL-Host,3,Localhost line1=Konfigurierbare Options,11 line2=Systemkonfiguration,11 login=Administrations-Login,0 mysql=Pfad zum mysql-Befehl,0 mysql_libs=Pfad zu MySQL-Bibliotheken,3,Keiner mysqladmin=Pfad zum mysqladmin-Befehl,0 mysqldump=Pfad zum mysqldump-Befehl,0 mysqlimport=Pfad zum mysqlimport-Befehl,0 mysqlshow=Pfad zum mysqlshow-Befehl,0 nodbi=Benutze DBI zur Verbindung wenn verfügbar?,1,0-Ja,1-Nein pass=Administrations-Paßwort,0 perpage=Anzahl anzuzeigender Reihen je Seite,0 port=MySQL-Port zu welchem verbunden wird,3,Standard sock=MySQL socket-Datei,3,Vorgabe start_cmd=Befehl zum Start des MySQL-Servers,0 stop_cmd=Befehl zum Stoppen des MySQL-Servers,3,Automatisch style=Zeige Datenbanken und Tabellen als,1,1-Liste,0-Icons mysql/help/0000755000567100000120000000000011220734045012631 5ustar jcameronwheelmysql/help/intro.ca.html0000644000567100000120000000143411220734044015235 0ustar jcameronwheel
Servidor de Bases de Dades MySQL
MySQL s un servidor de bases de dades senzill per a sistemes Unix. Suporta bases de dades mltiples, controls d'accs potents, molts tipus de dades i la majoria de sintaxi SQL estndard. Cada base de dades gestionada pel servidor pot contenir mltiples taules, i cada taula mltiples files de dades.

La pgina principal mostra una llista d'icones de bases de dades a la part superior, amb un enlla per afegir-ne una de nova a sota. Tot servidor MySQL t almenys la base de dades mysql, que emmagatzema les taules de configuraci i control d'accs. Ms avall de les bases de dades hi ha unes icones per configurar el control d'accs, i a baix de tot hi ha un bot per engegar o aturar el servidor de bases de dades.


mysql/help/edit_tpriv.ca.html0000644000567100000120000000052711220734044016255 0ustar jcameronwheel
Edici de Permisos de Taula
Aquesta pgina permet editar un conjunt existent de permisos taula-usuari. Desprs d'editar els permisos, fes clic sobre el bot Desa per tal que els canvis tinguin efecte immediatament. Tamb pots fer clic sobre Suprimeix per eliminar els permisos.


mysql/help/create_field.sv.html0000644000567100000120000000036511220734044016557 0ustar jcameronwheel
Lgg till flt
P denna sida kan du lgga till flt i tabellen. De parametrar du kan ndra p fr det nya fltet r: Nr du r klar trycker du p Spara, s uppdateras tabellen med det nya fltet.
mysql/help/edit_field.it.html0000755000567100000120000000062311220734044016225 0ustar jcameronwheel
Modifica campo
In questa pagina puoi modificare un campo di una tabella. Il tipo di dato del campo non pu essere modificate, ma hai la possibilit di cambiare altri parametri del campo come: Una volta concluse le modifiche clicca su Salva per aggiornare la struttura della tabella o su Elimina per rimuovere il campo dalla tabella.


mysql/help/edit_tpriv.es.html0000644000567100000120000000054411220734044016300 0ustar jcameronwheel
Permisos para Editar Tabla
Esta pgina te permite editar un conjunto existente de permisos del tipo tabla-usuario. Tras editarlo, haz click en el botn Salvar para hacer que los campos entren en vigor inmeditamente. Puedes tambin hacer click en Borrar para borrar los permisos de MySQL.


mysql/help/cprivs.ca.html0000644000567100000120000000112511220734044015405 0ustar jcameronwheel
Permisos de Columna
Aquest camp permet concedir als usuaris accessos addicionals a columnes especfiques de taules. Els permisos concedits no poden ser superiors a aquells especificats als Permisos de Taules per a la taula on est continguda la columna.

Per afegir nous permisos de columna, primer has de seleccionar la base de dades i la taula on est continguda la columna fent servir el formulari del peu de la pgina. Llavors, fes clic sobre el bot Afegeix permisos nous per treure un formulari per seleccionar la columna i altres detalls.


mysql/help/tprivs.zh_TW.Big5.html0000644000567100000120000000053711220734044016671 0ustar jcameronwheel
ƪv
o@iHz⤩ϥΪ̦bϥΪvƮwvSB~ƪsv. ovu|MΦb@ϥΪ̦s@ƮwSwƪ, \zLխn»Pv.

nW[sƪv, znbݿܸƪҦbƮw, MUW[svsHoܪƪLӸ`.


mysql/help/field.sv.html0000644000567100000120000000156311220734044015235 0ustar jcameronwheel
Fltnamn
Namnet p detta flt i tabellen.
Numeriska vrden (fr enum- och set-typer)
En lista ver mjliga vrden fr detta flt.
Lngd och decimaler (fr float- och decimaltyper)
Den totala fltlngden och antalet siffror till hger om decimalpunkten.
Typlngd (fr vriga typer)
Det maximala antalet tilltna tecken fr detta flt.
Tillval fr typ
Fr numeriska flt kan du hr vlja om fltet ska kunna innehlla negativa tal och om det ska fyllas ut med nollor till vnster. Fr teckenflt kan du vlja om det ska gras skillnad mellan versaler och gemener vid sortering.
Tomma flt tilltna?
Hr anger du om NULL-vrden r tilltna i fltet.
Standardvrde
Det vrde som fylls i fltet vid skapande av en ny post.
mysql/help/field.html0000644000567100000120000000161011220734044014577 0ustar jcameronwheel
Field name
The name of this field in the table.

Enumerated values (for enum and set types)
A list of possible values for this field.

Width and decimals (for float and decimal types)
The total width of this field, and the number of digits to the right of the decimal point.

Type width (for other types)
The maximum number of characters allowed for data in this field.

Type options
For numeric fields, this parameter allows you to choose whether the field is unsigned or left-padded with zeros. For character fields, you can choose whether case is taken into account when sorting or not.

Allow nulls?
Determines whether NULL values are allowed in this field

Default value
The default value for this field in new records

mysql/help/db.it.html0000755000567100000120000000122011220734044014514 0ustar jcameronwheelSono disponibili i seguenti parametri:
Database
I database ai quali viene permesso l'accesso. E' possibile inserire anche un'espressione regolare SQL.

Nome utente
L'utente a cui permesso accedere al database di cui sopra. Questo utente deve essere esistente nella tabella Permessi agli utenti.

Host
Gli host dai quali l'utente pu accedere al database. Se l'opzione Dai permessi degli host selezionata MySQL user i Permessi Host per controllare l'accesso.

Permessi
Le operazioni di MySQL che l'utente pu eseguire sul database.

mysql/help/edit_cpriv.hu.html0000644000567100000120000000052011220734044016256 0ustar jcameronwheel
Mez-jogosultsgok mdostsa
Ezen az oldalon mr meglv oszlop-felhasznli jogosultsgokat mdosthat. A mdostst kveten kattintson a Ments gombra a vltoztatsok azonnali rvnyestshez. Jogosultsgok trlshez a MySQL-bl kattintson a Trls gombra.


mysql/help/table_form.sv.html0000644000567100000120000000046211220734044016261 0ustar jcameronwheel
Skapa tabell
I detta formulr kan du skapa en ny, tom tabell. Du mste ange namn p tabellen samt ett eller flera flt. Fr varje flt mste du ange namn, datatyp och typlngd (om sdan finns fr datatypen). Nr du r klar trycker du p Skapa s skapas tabellen direkt.
mysql/help/intro.zh_TW.Big5.html0000644000567100000120000000074411220734044016475 0ustar jcameronwheel
MySQL ƮwA
MySQL O@ӵ Unix tΨϥΪ²ƮwA. 䴩hƮw, jOs, hظOPhƪз SQL O. ӳQA޲zƮwiHhƪ, CӸƪS]thӤP쪺.

DnebWCXFƮwϥ, P@ӼW[sƮws. C MySQL Aܤ֦@ӥs mysql Ʈw, oxsFպAPsC. eUhOΥHպAsϥ, ݫhO/ҰʸƮwAs.


mysql/help/db.ca.html0000644000567100000120000000130011220734044014457 0ustar jcameronwheelEs troben disponibles els segents parmetres:
Bases de Dades
Les bases de dades a les quals es permet l'accs, Aix pot ser una expressi regular SQL, si s'escau.

Usuari
L'usuari que t perms l'accs a les bases de dades de sobre. Aquest usuari ja ha d'existir a la taula de Permisos d'Usuari.

Hosts
Els hosts des dels quals l'usuari pot accedir aquesta taula. Si es tria l'opci Dels permisos del host, llavors MySQL utilitzar els Permisos del Host per controlar l'accs.

Permisos
Les operacions MySQL que l'usuari t permeses de fer sobre les bases de dades.

mysql/help/dbs.html0000644000567100000120000000074611220734044014275 0ustar jcameronwheel
Database Permissions
This page allows you to define which MySQL users will have access to which databases from which hosts. Every user must already exist in the User Permissions table, though they can be granted additional permissions here.

Users may not login from any hosts other than those specified in User Permissions. However, you may grant different permissions for different hosts by creating multiple rows for the same user.


mysql/help/tpriv.zh_TW.Big5.html0000644000567100000120000000063211220734044016502 0ustar jcameronwheelziHϥΤUCѼ:
ƪ
ovnMΪƪ.

ϥΪ̦W
ovnvϥΪ. oӨϥΪ̥wgsbϥΪvƪ.

D
oӨϥΪ̥iHsƪӷD.

ƪv
nvϥΪ̭ӸƪҦ쪺v.

v
ƪvnvϥΪ̪̤jv.

mysql/help/create_tpriv.hu.html0000644000567100000120000000044011220734044016616 0ustar jcameronwheel
Tblzat-jogosultsgok ltrehozsa
Ezen az oldalon j tblzat-felhasznli jogosultsgokat hozhat ltre. Az j tblzat-jogosultsgok hozzadst kveten kattintson a Ments gombra a jogosultsgok azonnali ltrehozatalhoz.


mysql/help/user.sv.html0000644000567100000120000000143011220734044015121 0ustar jcameronwheelFr varje anvndare kan fljande instllningar gras:
Anvndarnamn
Hr kan du skriva in ett anvndarnamn eller vlja Anonym anvndare, vilket resulterar i att rttigheterna gller fr alla anvndare som inte finns i tabellen Anvndarrttigheter.
Lsenord
Det lsenord som anvndaren ska ange nr han/hon loggar in. Om lsenord inte krvs vljer du Inget.
Datorer
IP-adress eller namn p den dator som anvndaren fr logga in frn. I detta flt kan du ocks ange ett reguljrt SQL-uttryck som expanderas till flera datorer, t ex 192.168.1.% och %.foo.com.
Rttigheter
MySQL-operationer som denna anvndare fr utfra p alla databaser. mysql/help/edit_tpriv.it.html0000755000567100000120000000044211220734044016305 0ustar jcameronwheel
Modifica i permessi sulla tabella
Questa pagina ti permette di modificare i permessi esistenti sulla tabella. Dopo le modifiche clicca su Salva per applicarle. Puoi anche cliccare su Elimina per eliminare i permessi.


mysql/help/edit_db.hu.html0000644000567100000120000000052111220734044015521 0ustar jcameronwheel
Adatbzis-jogosultsgok mdostsa
Ezen az oldalon mr meglv adatbzis-felhasznli jogosultsgokat mdosthat. A mdostst kveten kattintson a Ments gombra a mdostsok azonnali rvnyestshez. Jogosultsgok trlshez a MySQL-bl kattintson a Trls gombra.


mysql/help/user.es.html0000644000567100000120000000163311220734044015105 0ustar jcameronwheelPara cada usuario estn disponibles los siguientes parmetros:
Nombre de usuario
Para este campo, debes de digitar o un nombre especfico de usuario o seleccionar la opcin de Usuario annimo, del cual se aplicarn los permisos a cualquier usuario que no est en la lista de Permisos de Usuario.

Clave de Acceso
La clave de acceso necesaria para este usuario cuando haga login. Si Ninguna, no hace falta clave de acceso.

Mquinas
La direccin IP o nombre de mquina de la mquina desde la que este usuario est autorizado a hacer login. Este campo puede contener tambin una expresin SQL regular que coincida con mtiples mquinas, como 192.168.1.% o %.foo.com.

Permisos
Las operaciones MySQL que este usuario est autorizado a realizar en una base de datos.

mysql/help/users.it.html0000755000567100000120000000122511220734044015275 0ustar jcameronwheel

Permessi agli utenti
Questa pagina ti permette di creare e modificare gli utenti che avranno accesso ai database di MySQL.
Per ciascun utente possibile specificare un nome utente, una password, gli host da cui possibile connettersi e un insieme di permessi che determina ci che l'utente pu fare.

Visto che i permessi impostati per ciascun utente riguarderanno tutti i database buona norma non garantire agli utenti in questa pagina tutti i permessi. E' invece pi opportuno usare la pagina relativa ai Permessi sui database per impostare i diritti di accesso per ciascun database agli utenti.


mysql/help/field.it.html0000755000567100000120000000153511220734044015223 0ustar jcameronwheel
Nome Campo
Il nome di questo campo nella tabella.

Elenco valori (per i tipi enum e set)
Una lista di possibili valori per questo campo.

Lunghezza e decimali (per i tipi float e decimal)
La lunghezza totale di questo campo e il numero di cifre decimali da utilizzare.

Lunghezza (per tutti gli altri tipi)
Il numero massimo di caratteri permessi per i dati in questo campo.

Opzioni specifiche per il tipo
Questo parametro ti permette di definire delle opzioni specifiche per il tipo di dato scelto per il campo.

Permetti valori nulli?
Determina se il valore NULL (nullo) permesso in questo campo

Valore di defautl
Il valore predefinito per questo campo nei nuovi record

mysql/help/backup_form.ca.html0000644000567100000120000000116511220734044016373 0ustar jcameronwheel
Volcat de la Base de Dades
Aquest formulari permet fer un volcat de tota una base de dades (o de les files seleccionades) a un fitxer. Selecciona el fitxer on vols volcar la base de dades i les altres opcions, llavors fes clic sobre el bot Volca BD per iniciar el procs de cpia. S'escriuran al fitxer les instruccions SQL que, en executar-se, recrearan les taules de la base de dades i els seus continguts. Per tal de restaurar la base de dades, es pot executar aquest fitxer es pot executar fent servir el programa de la lnia d'ordres mysql o b la pgina d'Execuci de SQL.


mysql/help/edit_field.hu.html0000644000567100000120000000060311220734044016220 0ustar jcameronwheel
Mez mdostsa
Ezen az oldalon tblzatok mr meglv mezit mdosthatja. Jllehet a mez alapvet adattpusa nem vltoztathat, az albbi paramterek mdostsra van lehetsg : Ha elkszlt, kattintson a Ments gombra a tblzatstruktra frisstshez, vagy a Trls gombra a mez eltvoltshoz a tblzatbl.


mysql/help/create_field.zh_TW.Big5.html0000644000567100000120000000025211220734044017742 0ustar jcameronwheel
W[
bo@ziHW[@ӷsƪ. siHs誺ѼƬ: , UxsHϥηssƪc.
mysql/help/create_cpriv.zh_TW.Big5.html0000644000567100000120000000023711220734044020005 0ustar jcameronwheel
إv
o@iHzإߤ@ӷsϥΪv. bJsv, UxsHߨإ߷sv.


mysql/help/dbs.zh_TW.Big5.html0000644000567100000120000000054511220734044016111 0ustar jcameronwheel
Ʈwv
o@iHzwq MySQL ϥΪ̥iHqǥDsǸƮw. CӨϥΪ̳wgsbϥΪvƪ, åB̥iHboohv.

ϥΪ̤qwϥΪv~DnJƮw. M, ziHgѦboP@ӨϥΪ̫إߦhӤPDPv, ϱoϥΪ̨ӦۤPDɦPv.


mysql/help/newdb_form.ca.html0000644000567100000120000000056511220734044016230 0ustar jcameronwheel
Creaci de Base de Dades
Aquest formulari permet crear una nova base de dades MySQL, amb una taula inicial opcional. Has d'introduir el nom de la base de dades, i si crees una taula inicial, el nom de la taula i els detalls d'almenys una columna. En acabat, fes clic sobre el bot Crea per crear la base de dades de forma immediata.


mysql/help/edit_dbase.zh_TW.UTF-8.html0000664000567100000120000000065411220734044017444 0ustar jcameronwheel
編輯資料庫
在這一頁頂端有數列的圖示, 每一個圖示代表了資料庫中的資料表. 按下圖示, 您可以編輯資料表的結構.

在下面的按鈕則使用以在這個資料庫中建立新的資料表, 在資料庫中資料表執行 SQL 查詢與丟棄這個資料庫與其中的所有資料. 使用丟棄資料庫按鈕時要特別小心, 因為這是不可復原的!


mysql/help/edit_field.es.html0000644000567100000120000000061611220734044016217 0ustar jcameronwheel
Editar Campo
En esta pgina puedes editar un campo de tabla existente. Aqunque el tipo de datos bsico del campo no puede ser cambiado, ests autorizado a modificar otros parmetros de campo tales como: Al terminar, haz click en el botn Salvar para actualizar la estructura de la tabla o en Borrar para quitar el campo de la tabla.


mysql/help/tprivs.ca.html0000644000567100000120000000124111220734044015425 0ustar jcameronwheel
Permisos de Taula
La pgina permet concedir permisos addicionals a les taules per part dels usuaris, ms enll del que est disponible a Permisos d'Usuaris o Permisos de Bases de Dades. Els permisos concedits aqu s'apliquen noms a l'accs a una taula d'una base de dades per part d'un usuari, permetent aix un accs molt restringit.

Per afegir nous permisos de taules, primer has de seleccionar la base de dades on est continguda la taula, utilitzant el formulari del peu de la pgina. Desprs, fes clic sobre el bot Afegeix permisos nous per obrir un formulari per seleccionar la taula i altres detalls.


mysql/help/create_field.zh_TW.UTF-8.html0000664000567100000120000000034211220734044017761 0ustar jcameronwheel
增加欄位
在這一頁您可以增加一個新的欄位到資料表中. 對新欄位可以編輯的參數為: 完成後, 按下儲存以使用新欄位更新資料表結構.
mysql/help/vars.ca.html0000755000567100000120000000046111220734044015057 0ustar jcameronwheel
Variables del Sistema MySQL
Aquesta pgina llista totes les variables internes actualment definides al sevidor MySQL. Aquelles classificades com a variables de sistema es poden editar seleccionant la casella del costat i prement el bot Edita del peu de la pgina.