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;
}
?>
Ïà¹ØÎĵµ£º
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, “ ......
1,ÔÚwindow×Ô´øµÄ·À»ðǽÀïµÄÀýÍâÌí¼Ó3306¶Ë¿Ú£¬ÎªTCP
2£¬½ñÌìÔÚÓÃÔ¶³ÌÁ¬½ÓMysql·þÎñÆ÷µÄÊý¾Ý¿â£¬²»¹ÜÔõôŪ¶¼ÊÇÁ¬½Ó²»µ½£¬´íÎó´úÂëÊÇ1130£¬ERROR 1130: Host 192.168.2.159 is not allowed to connect to this MySQL server
²ÂÏëÊÇÎÞ·¨¸øÔ¶³ÌÁ¬½ÓµÄÓû§È¨ÏÞÎÊÌâ¡£½á¹ûÕâÑù×Ó²Ù×÷mysql¿â£¬¼´¿É½â¾ö¡£ÔÚ±¾»úµÇÈëmysqlºó£¬¸ ......
²éѯÓï¾ä:
SELECT ×Ö¶ÎÃû from ±íÃû.
ÅÅÐò order by ÒªÅÅÐòµÄ×Ö¶ÎÃû desc :ÒÔµ¹Ðò²éѯ.
limit ´ÓµÚ¼¸¸ö¿ªÊ¼ ²éÕÒ¶àÉÙ¸ö :²éÕÒÖ¸¶¨¸öÊý.
ͬʱ²éѯ¶à¸ö×Ö¶ÎÓÃ","¸ô¿ª.
Èç²éѯ±íÀïÃæµÄËùÓÐÊý¾ÝÔÚ×Ö¶ÎÃû´¦Ìî"*".
ÈçÖ»ÏëÏÔʾij×ֶεÄǰ¼¸Î»×Ö·û¿ÉÒÔʹÓÃLEFTº¯Êý.
SELECT ×Ö¶ÎÃû,LEFT(×Ö¶ÎÃû,λÊý),×Ö¶ÎÃû from ±íÃû.
COU ......
NDBCLUSTER
(also known as NDB
) is an in-memory
storage engine offering high-availability and data-persistence
features.
The NDBCLUSTER
storage engine can be
configured with a range of failover and load-balancing options,
but it is easiest t ......