Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql ±¸·ÝÁ·Ï°

<?php
$db_name="new";
mysql_connect("localhost","root","123456");
mysql_select_db($db_name);
$tb=mysql_list_tables($db_name);
$sql="";
while($query=mysql_fetch_row($tb)){
 $sql="";$table_sql="";
    $sql.= get_table_fn($query[0]);
    get_table_row($query[0]);
   // echo $table_sql."\n";
}
$f=fopen($db_name.".sql","w+");
fwrite($f,$sql);
fclose($f);
//±¸·ÝËùÓбíSQLÓïÃû
function get_table_fn($db_name){
 $field="CREATE TABLE `$db_name`( \n";
  $query=mysql_query("select * from $db_name");
 while($row=mysql_fetch_field($query)){
   if($row->not_null===1){$null="DEFAULE NULL";}else{$null="NOT NULL";}
   if($row->primary_key===1){$key="primary key";}else{$key="";}
   if($row->unsigned===1){$unsig="unsigned";}else{$unsig="";}
   $field.="`$row->name` $row->type($row->max_length) $null $key $unsig ,\n";
 }
 $field.=")\n";
 return $field;
}
//±¸·ÝËùÓбíµÄÊý¾ç
function get_table_row($db_name){
     $query=mysql_query("select * from $db_name");
     $field="";
     $num_rows= mysql_num_rows($query);
     $num_field=mysql_num_fields($query);
        $table_sqls="";
  while($row=mysql_fetch_row($query)){
     $r= get_table_fd($num_field,$row);
     $table_sqls.="insert into `$db_name` values($r)\n";
   }
  $f=fopen($db_name.".sql","w+");
  fwrite($f,$table_sqls);
  fclose($f);
}
//»ñȡÿÕűíµÄ×Ö¶ÎÖµ
function get_table_fd($num_field,$row){
 $r="";
 for($i=0;$i<$num_field;$i++){
  $r.= "'$row[$i]',";
 }
    $r=substr($r, 0, strlen($r)-1);
    return  $r;
}
?>


Ïà¹ØÎĵµ£º

Safe Shutdown and Restart of MySQL Cluster


To shut down the cluster, enter the following command in a shell
on the machine hosting the management node:

shell> ndb_mgm -e shutdown
The -e
option here is used to pass a command to
the ndb_mgm
client from the shell. (See
Section 4.23, “ ......

MysqlµÄGROUP_CONCAT()º¯ÊýʹÓ÷½·¨ ¶àÐкϲ¢º¯Êý

GROUP_CONCAT ÊÇÒ»¸öºÏ²¢¶àÐеĺ¯Êý£¬Ò»°ãÓõÄÉÙ£¬ËùÒԺܶàÈ˶¼²»ÖªµÀ£¬ÎÒÒ²ÊÇÒ»¸ö£¬½ñÌìżȻ¿´µ½£¬¹Ê¼ÇÏ·½·¨£»
GROUP_CONCATµÄÓï·¨ÈçÏ£º
GROUP_CONCAT([DISTINCT] expr [,expr ...][ORDER BY {unsigned_integer | col_name | expr}[ASC | DESC] [,col_name ...]][SEPARATOR str_val])
ÏÂÃæÑÝʾһÏÂÕâ¸öº¯Êý£¬ÏȽ¨Á¢Ò ......

mysql 5.1 configure ±àÒë²ÎÊýÏê½â

-static  13%
   --with-client-ldflags=-all-static
  
--with-mysqld-ldflags=-all-static
¾²Ì¬Á´½ÓÌá¸ß13%ÐÔÄÜ
Unix Socket  7.5%
--with-unix-socket path=/usr/local/mysql/tmp/mysql.sock
ʹÓÃunixÌ×½Ó×ÖÁ´½ÓÌá¸ß7.5%ÐÔÄÜ£¬ËùÒÔÔÚwindowsÏÂmysqlÐÔÄܿ϶¨²»ÈçunixÏÂÃæ
--enab ......

How to change max_allowed_packet value in mysql?

 
If you set it in the cnf(it may be my.ini file) you will likely need to restart the server. Optionally, that is a dynamic variable and can be SET GLOBAL or SET SESSION from the command line as well.So just do as follows.
 
mysql>show variables like’max_allowed_packet’; ......

¡¾×ª¡¿mysql½â¾ö×Ô¶¯¶Ï¿ª8Ð¡Ê±Î´ÔøÓùýµÄÁ´½Ó

http://www.cnblogs.com/neonlight/archive/2008/08/25/1276178.html
½üÒ»¶Îʱ¼ä£¬ºÜ¶à²¿ÃÅͬÊ·´Ó³ÔÚʹÓÃmysqlµÄ¹ý³Ì³öÏÖÊý¾Ý¿âÁ¬½Ó×Ô¶¯¶Ï¿ªµÄÎÊÌ⣬ÎÒ¶Ô¸ÃÎÊÌâ×öÁËһЩʵÑé¡£
¹ØÓÚmysql×Ô¶¯¶Ï¿ªµÄÎÊÌâÑо¿½á¹ûÈçÏ£¬ÔÚmysqlÖÐÓÐÏà¹Ø²ÎÊýÉ趨£¬µ±Êý¾Ý¿âÁ¬½Ó¿ÕÏÐÒ»¶¨Ê±¼äºó£¬·þÎñÆ÷¾Í
»á¶Ï¿ªµÈ´ý³¬Ê±µÄÁ¬½Ó£º
1¡¢Ïà¹Ø²Î ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ