ƽʱ×Ô¼ºÖ±½Ó²Ù×÷Êý¾Ý¿âµÄÇé¿ö±È½ÏÉÙ£¬¾ÍÊÇÓõ½µÄ»°Ò²Ò»°ãÊÇÓÃЩ¿ÉÊÓ»¯µÄ¿Í»§¶Ë£¬ËùÒÔһЩÃüÁîÐеÄÃüÁÍüµôÁË¡£½ñÌìÔÚһ̨ûÓпͻ§¶ËµÄ»úÆ÷Éϱ»¸ãµÄºÜÀDZ·£¬ÏÖÔڼǼһϼ¸¸öСÎÊÌ⣺
µÇ¼£º
MysqlÃüÁîÐеǽ:mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Òâ:(1)Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö²ÎÊý-h»úÆ÷IP£¬Ò²¾ÍÊÇ˵(±È·½ËµÊDZ¾»ú):
mysql -h localhost -uroot -p
(2)Èç¹ûÏëÖ±½Ó½øÈëÒª·ÃÎʵÄÊý¾Ý¿â£¬¿ÉÒÔÕâÑù£º
mysql -h localhost -uroot -p mydatabase
²é¿´µ±Ç°·ÃÎʵÄÊý¾Ý¿â£º
Óм¸ÖÖ·½·¨£º(1) select database();
mysql> select database()
+------------+
| database() |
+------------+
| mysql |
+------------+
1 row in set (0.00 sec)
£¨2£©Ö±½Óshow tablesÒ²¿ÉÒÔ¿´³öÀ´
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
ÃüÁîÐÐÖ´ÐÐsql½Å±¾£º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 Õâ¸öʱºòλÖÃλÖÃÕýÈ·¼´¿É¡£
luber ÓÚ 2008-09-01 11:48:16·¢±í:
ÈëÃÅÃüÁлл·ÖÏí