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

MySQL cmdÃüÁî

Á¬½Ó£ºmysql -hÖ÷»úµØÖ· -uÓû§Ãû £­pÓû§ÃÜÂë £¨×¢:uÓëroot¿ÉÒÔ²»Óüӿոñ£¬ÆäËüÒ²Ò»Ñù£©
¶Ï¿ª£ºexit £¨»Ø³µ£©
´´½¨ÊÚȨ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by \"ÃÜÂë\"
ÐÞ¸ÄÃÜÂ룺mysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
ɾ³ýÊÚȨ: revoke select,insert,update,delete om *.* from test2@localhost;
ÏÔʾÊý¾Ý¿â£ºshow databases;
ÏÔʾÊý¾Ý±í£ºshow tables;
ÏÔʾ±í½á¹¹£ºdescribe ±íÃû;
´´½¨¿â£ºcreate database ¿âÃû;
ɾ³ý¿â£ºdrop database ¿âÃû;
ʹÓÿ⣺use ¿âÃû;
´´½¨±í£ºcreate table ±íÃû (×Ö¶ÎÉ趨Áбí);
ɾ³ý±í£ºdrop table ±íÃû;
ÐÞ¸Ä±í£ºalter table t1 rename t2
²éѯ±í£ºselect * from ±íÃû;
Çå¿Õ±í£ºdelete from ±íÃû;
±¸·Ý±í: mysqlbinmysqldump -h(ip) -uroot -p(password) databasename tablename > tablename.sql
»Ö¸´±í: mysqlbinmysql -h(ip) -uroot -p(password) databasename tablename < tablename.sql£¨²Ù×÷Ç°ÏÈ°ÑÔ­À´±íɾ³ý£©
Ôö¼ÓÁУºALTER TABLE t2 ADD c INT UNSIGNED NOT NULL AUTO_INCREMENT,ADD INDEX (c);
ÐÞ¸ÄÁУºALTER TABLE t2 MODIFY a TINYINT NOT NULL, CHANGE b c CHAR(20);
ɾ³ýÁУºALTER TABLE t2 DROP COLUMN c;
±¸·ÝÊý¾Ý¿â£ºmysql\bin\mysqldump -h(ip) -uroot -p(password) databasename > database.sql
»Ö¸´Êý¾Ý¿â£ºmysql\bin\mysql -h(ip) -uroot -p(password) databasename < database.sql
¸´ÖÆÊý¾Ý¿â£ºmysql\bin\mysqldump --all-databases > all-databases.sql
ÐÞ¸´Êý¾Ý¿â£ºmysqlcheck -A -o -uroot -p54safer
Îı¾Êý¾Ýµ¼È룺 load data local infile \"ÎļþÃû\" into table ±íÃû;
Êý¾Ýµ¼Èëµ¼³ö£ºmysql\bin\mysqlimport database tables.txt


Ïà¹ØÎĵµ£º

ASP.NETÓëMySqlµÄÁ¬½Ó——ÍøÕ¾µÄ²¿Êð

1. Êý¾Ý¿âµÄ²¿Êð
£¨1£©Èí¼þµÄ°²×°
A. MySql——±ØÐë°²×°ÔÚCÅÌÏ£¬·ñÔò°²×°mysql-connector-net-6.2.2ºóÎÞÕýÈ·ÅäÖÃ
B. mysql-connector-net-6.2.2——½«MySql.Data.dll·ÅÔÚBinÎļþ¼ÐÏÂ
£¨2£©Êý¾Ý¿âµÄµ¼³öµ¼Èë
MySQL-FrontµÄ"Áí´æΪ"¹¦ÄÜ¿ÉÒÔ½«Êý¾Ý¿âµ¼³öΪ.sqlÎļþ£¬È»ºóÔÙͨ¹ýËüÖ±½Óµ¼Èë.sqlÎļþ¿ ......

mysqlÊý¾Ý¿âsqlÎļþµ¼Èëµ¼³öÃüÁî

¡¡¡¡1.µ¼³öÕû¸öÊý¾Ý¿â
¡¡¡¡       mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
¡¡¡¡       mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
¡¡¡¡2.µ¼³öÒ»¸ö±í
¡¡¡¡      mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> ......

mysqlÈ¡µÃÊý¾Ý¿âËùÓбíÃûºÍ×Ö¶Î×¢ÊÍ

1¡¢È¡×Ö¶Î×¢ÊÍ
Select COLUMN_NAME ÁÐÃû, DATA_TYPE ×Ö¶ÎÀàÐÍ, COLUMN_COMMENT ×Ö¶Î×¢ÊÍ
from INFORMATION_SCHEMA.COLUMNS
Where table_name = 'companies'##±íÃû
AND table_schema = 'testhuicard'##Êý¾Ý¿âÃû
AND column_name LIKE 'c_name'##×Ö¶ÎÃû
2¡¢È¡µÃ±í×¢ÊÍ
Select table_name ±íÃû,TABLE_COMMENT ±í×¢ÊÍ ......

MySqlѧϰ±Ê¼Ç

MySqlѧϰ±Ê¼Ç MySql¸ÅÊö£ºMySqlÊÇÒ»¸öÖÖ¹ØÁªÊý¾Ý¿â¹ÜÀíϵͳ£¬Ëùν¹ØÁªÊý¾Ý¿â¾ÍÊǽ«Êý¾Ý±£´æÔÚ²»Í¬µÄ±íÖУ¬¶ø²»Êǽ«ËùÓÐÊý¾Ý·ÅÔÚÒ»¸ö´óµÄ²Ö¿âÖС£ÕâÑù¾ÍÔö¼ÓÁËËÙ¶ÈÓëÌá¸ßÁËÁé»îÐÔ¡£²¢ÇÒMySqlÈí¼þÊÇÒ»¸ö¿ª·ÅÔ´ÂëÈí¼þ¡£ ×¢Ò⣬MySqlËùÖ§³ÖµÄTimeStampµÄ×î´ó·¶Î§µÄÎÊÌ⣬ÔÚ32λ»úÆ÷ÉÏ£¬Ö§³ÖµÄÈ¡Öµ·¶Î§ÊÇÄê·Ý×îºÃ²»Òª³¬¹ý2030Äê ......

ͨÓõÄmysql dump³ÌÐò

¿ÉÒÔÊÊÓÃÈκÎsql , ×Ô¶¯Ê¶±ð×Ö¶ÎÃû£¬ gzipѹËõ , ´øÊä³öbuffer , Ö§³Ö·Ö¿â·Ö±í
ÐèÒª¸¨Öú´úÂëºÍMakefie , ÏÂÃæÊÇÖ÷³ÌÐò´úÂ룬 
/**
* mysqlÊý¾Ý±ídump³ÌÐò
* @author : cheng limin
* @date : 2010-1-18
*
* ʹÓÃÑùÀý:
*./dump_mysql -c ../conf/dump.conf
* -t xml
* -s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ