MySQL±¸·Ý¡¢»¹Ô
»¹ÔÒ»¸öÊý¾Ý¿â:mysql -h localhost -u root -p123456 www<c:\www.sql
±¸·ÝÒ»¸öÊý¾Ý¿â:mysqldump -h localhost -u root -p123456 www > d:\www2008-2-26.sql
//ÒÔÏÂÊÇÔÚ³ÌÐòÖнøÐвâÊÔ
//$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
$command="mysqldump -h localhost -u root -p123456 guestbook > guestbook2-29.sql";
system($command);
echo "success";
************************************************
±¸·ÝMySQLÊý¾Ý¿âµÄÃüÁî
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ£¬Äܹ»Èøñ¸·Ý¸²¸ÇÒÑÓÐÊý¾Ý¿â¶ø²»ÐèÒªÊÖ¶¯É¾³ýÔÓÐÊý¾Ý¿â¡£
mysqldump -–add-drop-table -uusername -ppassword databasename > backupfile.sql
Ö±½Ó½«MySQLÊý¾Ý¿âѹËõ±¸·Ý
mysqldump -hhostname -uusername -ppassword databasename | gzip > backupfile.sql.gz
±¸·ÝMySQLÊý¾Ý¿âij¸ö(Щ)±í
mysqldump -hhostname -uusername -ppassword databasename specific_table1 specific_table2 > backupfile.sql
ͬʱ±¸·Ý¶à¸öMySQLÊý¾Ý¿â
mysqldump -hhostname -uusername -ppassword –databases databasename1 databasename2 databasename3 > multibackupfile.sql
½ö½ö±¸·ÝÊý¾Ý¿â½á¹¹
mysqldump –no-data –databases databasename1 databasename2 databasename3 > structurebackupfile.sql
±¸·Ý·þÎñÆ÷ÉÏËùÓÐÊý¾Ý¿â
mysqldump –all-databases > allbackupfile.sql
»¹ÔMySQLÊý¾Ý¿âµÄÃüÁî
mysql -hhostname -uusername -ppassword databasename < backupfile.sql
»¹ÔѹËõµÄMySQLÊý¾Ý¿â
gunzip < backupfile.sql.gz | mysql -uusername -ppassword databasename
½«Êý¾Ý¿âתÒƵ½Ð·þÎñÆ÷
mysqldump -uusername -ppassword databasename | mysql –host=*.*.*.* -C databasename
¼¸¸ö³£ÓÃÓÃÀý£º
1.µ¼³öÕû¸öÊý¾Ý¿â
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
mysqldump -u root -p dataname >dataname.sql
Õâ¸öʱºò»áÌáʾҪÄãÊäÈërootÓû§ÃûµÄÃÜÂë,ÊäÈëÃÜÂëºódatanameÊý¾Ý¿â¾Í³É¹¦±¸·ÝÔÚmysql/bin/Ŀ¼ÖÐ.
2.µ¼³öÒ»¸ö±í
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> µ¼³
Ïà¹ØÎĵµ£º
¾ÍÏóÐí¶àµÄPHP¿ª·¢ÕßÒ»Ñù£¬ÔÚ¸Õ¿ªÊ¼½¨Á¢¶¯Ì¬ÍøÕ¾µÄʱºò£¬ÎÒ¶¼ÊÇʹÓÃÏà¶Ô¼òµ¥
µÄÊý¾Ý½á¹¹¡£PHPÔÚÁ¬½ÓÊý¾Ý¿â·½ÃæµÄȷʵÊÇÊ®·Ö·½±ã£¨ÒëÕß×¢£ºÓÐЩÈËÈÏΪPHPÔÚÁ¬½Ó²»Í¬Êý¾Ý¿âʱûÓÐÒ»¸öͳһµÄ½Ó¿Ú£¬²»Ì«·½±ã£¬ÆäʵÕâ¿ÉÒÔͨ¹ýһЩÀ©
Õ¹¿âÀ´×öµ½ÕâÒ»µã£©£¬ÄãÎÞÐè¿´´óÁ¿µÄÉè¼ÆÎĵµ¾Í¿ÉÒÔ½¨Á¢ºÍʹÓÃÊý¾Ý¿â£¬ÕâÒ²ÊÇPHP»ñµÃ³É¹¦µÄÖ÷ ......
·þÎñÆ÷¶Ë´úÂë,amfphpµÄservicesĿ¼Ï½¨Á¢readData.phpÎļþ,´úÂëÈçÏÂ
<?php
class ReadDB
{
function getData()
&nb ......
MySQL»ù±¾ÊýÖµÀàÐÍ´óÖ¿ÉÒԷֳɣº
ÕûÊýÀàÐÍ£ºTINYINT¡¢SAMLLINT¡¢MEDIUMINT¡¢INT¡¢BIGINT--1×Ö½Ú¡¢2¡¢3.¡¢4¡¢8
¸¡µãÊýÀàÐÍ£ºFLOAT(m,d)¡¢DOUBLE(m,d)==REAL-4×Ö½Ú¡¢8
¶¨µãÊýÀàÐÍ£ºDECIMAL(m,d)¡¢NUMERIC-m+2×Ö½Ú¡¢8
λÀàÐÍ£ºBIT(m)-1-8×Ö½Ú
¸÷¸öÀàÐ͵ÄÏêϸ·¶Î§¿ÉÒԲο¼mysqlÎĵµ
Êý¾ÝÀàÐÍСÀý£º
1 ......
Õ⼸ÌìLinux·þÎñÆ÷ºÜÂý,ºÜ׿±ÕÒ²»µ½½â¾ö°ì·¨!ºó°Ù¶ÈÏà¹Ø×ÖÑÛ,²éÕÒµ½ÊÇMySQLµÄÎÊÌâ,
ÈçÏÂΪ½â¾ö·½°¸
:
Á¬½ÓMySQLËÙ¶ÈÂýµÄ½â¾ö·½·¨.
PHPÔ¶³ÌÁ¬½ÓMYSQLËÙ¶ÈÂý,ÓÐʱԶ³ÌÁ¬½Óµ½MYSQLÓÃʱ4-20Ãë²»µÈ,±¾µØÁ¬½ÓMYSQLÕý³£,³öÏÖÕâÖÖÎÊÌâµÄÖ÷ÒªÔÒòÊÇ,ĬÈÏ°²×°µÄ
MYSQL¿ªÆôÁËDNSµÄ·´Ïò½âÎö,ÔÚMY.CNF(UNIX»òLINUXϵͳÏÂ)»òMY.INI ......
MySQL ×Ö·û´®½ØÈ¡º¯Êý£ºleft(), right(), substring(), substring_index()¡£»¹ÓÐ mid(), substr()¡£ÆäÖУ¬mid(), substr() µÈ¼ÛÓÚ substring() º¯Êý£¬substring() µÄ¹¦Äܷdz£Ç¿´óºÍÁé»î¡£
1. ×Ö·û´®½ØÈ¡£ºleft(str, length)
mysql> select left('sqlstudy.com', 3);+-------------------------+| left('sqlstudy.com', 3) | ......