mysql> SOURCE [·¾¶]ÎļþÃû
mysql> SOURCE [·¾¶]ÎļþÃû
ÓÐÁ½ÖÖд·¨£º
1¡¢
mysql> SOURCE cr_pet_tbl.sql
Õâ¸öʱºò£¬cr_pet_tbl.sql±ØÐë·ÅÔÚÄãµÄmysql/binĿ¼ÏÂÃæ£¬¼´¸úmysql.exeͬһĿ¼
2¡£
mysql> SOURCE c:\cr_pet_tbl.sql
Õâ¸öʱºòλÖÃλÖÃÕýÈ·¼´¿É£¬
Ïà¹ØÎĵµ£º
1.¶Ô²éѯ½øÐÐÓÅ»¯£¬Ó¦¾¡Á¿±ÜÃâÈ«±íɨÃ裬Ê×ÏÈÓ¦¿¼ÂÇÔÚ where ¼° order by Éæ¼°µÄÁÐÉϽ¨Á¢Ë÷Òý¡£
2.Ó¦¾¡Á¿±ÜÃâÔÚ where ×Ó¾äÖжÔ×ֶνøÐÐ null ÖµÅжϣ¬·ñÔò½«µ¼ÖÂÒýÇæ
·ÅÆúʹÓÃË÷Òý¶ø½øÐÐÈ«±íɨÃ裬È磺
select id from t where num is null
¿ÉÒÔÔÚnumÉÏÉèÖÃ
ĬÈÏÖµ0£¬È·±£±íÖÐnumÁÐûÓÐnullÖµ£¬È»ºóÕâ
Ñù²éѯ£º
sel ......
³£ÓõÄ:
µ¼³ö
mysqldump -hyour_host -uyour_username -pyour_password database_name > file.sql
µ¼Èë
mysql -hyour_host -uyour_username -pyour_password database_name < file.sql
»òÕßÏÈÓÃmysql¿Í»§¶ËµÇ½ºó£¬
>\. file.sql
Ò²¿ÉÒÔÍê³Éµ¼È빦ÄÜ
ÉÏÃæµÄÁ½¸öÃüÁî½áºÏÆðÀ´Ó㬿ÉÒÔÍê³É½«Ò»¸öÊý¾Ý¿âµÄ ......
ǰ׺Ë÷Òý
(1)Èç¹ûÒÔ¶à¸ö×Ö¶Î×÷ΪË÷Òý£¨a,b£¬c)×÷Ϊһ¸ökey,ÔÚ²éѯʱ·Ö¸ù¾ÝÆ¥ÅäÇé¿öÊÇ·ñʹÓÃË÷Òý£¬ËùÒÔ£¬a/ a,b/ a,b,cÕâÑùµÄ²éѯ¶¼ÄÜʹÓõ½£¬µ«ÊÇb,a/a,c/c,aµÈ²»·û֪ǰ׺ƥÅä¾Í²»ÄÜʹÓã¬ËùÒÔÔÚдsqlʱÐèҪעÒâ
(2)¶ÔÓںܳ¤µÄ×Ö·û´®ÐèÒªÉú³Ékeyʱ£¬¿ÉÒÔÕÒ³ö×ʹÓõÄ×Ö·û´®µÄ×î³£¼ûǰ׺(ǰN¸ö×ÖÌõ×÷Ϊkey,¶ø²»Êǽ ......
ÏÂÃæÎÒ¸ø´ó¼Ò½éÉܼ¸ÖÖÔÚmysqlÊý¾Ý¿âÖÐÐÞ¸ÄrootÃÜÂëµÄ·½·¨
·½·¨Ò»£º
ÔʼÃÜÂëÊÇ ckh
mysql -uroot -pckh
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 5.0.22-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
my ......
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@localhost]# mysql -u root -p
Enter password:
ERROR 2002 (H ......