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
Ïà¹ØÎĵµ£º
Ò»¡¢²é¿´Óû§
1¡¢ÏÔʾµ±Ç°Ê¹ÓõÄuser¼°host£º
mysql>select USER();
2¡¢ÏÔʾ¸ÃÊý¾Ý¿âÊÚȨµÇ½µÄÓû§Ãû(²»ÏÔʾÖظ´Óû§Ãû)£º
mysql>use mysql;
mysql>select distinct(User) from user;
3¡¢ÏÔʾ¸ÃÊý¾Ý¿âÊÚȨµÇ½µÄÓû§Ãû¼°hostÏÞÖÆ£º
£¨1£©·½·¨Ò»£º
mysql>use mysql;
mysql>select User,host from u ......
ÉÏ´ÎÔÚÅöµ½ÕâÎÊÌ⣬ÔÚÍøÉÏÕÒÁ˽â¾ö·½·¨£¬¿ÉÊÇû¼ÇÏÂÀ´¡£ÕâÐÇÆÚÒª»»»úÆ÷£¬Òª°ÑÔÀ´linuxϵÄmysqlÊý¾Ý¿âÒƵ½Áíһ̨·þÎñÆ÷ÉÏ¡£°²×°suseϵͳ¡¢ÔÙÅäÖÃtelnet¡¢ftp·þÎñ¡¢°²×°java JDK²¢ÅäÖá¢ÔÙ°²×°eclipseºÍmysql,ÓÖ»¨ÁËÒ»ÌìµÄʱ¼ä¡£¸Ð¾õ»¹ÊDz»ÊìÁ·£¬ÅäÖ÷À»ðǽÀÏÊDz»Äܽ«telnetºÍftp·þÎñÅÅÍâ¡£mysqlÓÖÅöµ½ÁËÖÐÎÄÂÒÂëÎÊÌ⣬ÓÖÔÚ ......
ÒÔÏÂÕª×ÔÍøÂç
----------------------------------------
½ñÌìÔÚÓÃÔ¶³ÌÁ¬½ÓMysql·þÎñÆ÷µÄÊý¾Ý¿â£¬²»¹ÜÔõôŪ¶¼ÊÇÁ¬½Ó²»µ½£¬´íÎó´úÂëÊÇ1130£¬ERROR 1130: Host 192.168.2.159 is not allowed to connect to this MySQL server
²ÂÏëÊÇÎÞ·¨¸øÔ¶³ÌÁ¬½ÓµÄÓû§È¨ÏÞÎÊÌâ¡£½á¹ûÕâÑù×Ó²Ù×÷mysql¿â£¬¼´¿É½â¾ö¡£ÔÚ±¾»úµÇÈëmysqlº ......
¿ÉÒÔÊÊÓÃÈκÎsql , ×Ô¶¯Ê¶±ð×Ö¶ÎÃû£¬ gzipѹËõ , ´øÊä³öbuffer , Ö§³Ö·Ö¿â·Ö±í
ÐèÒª¸¨Öú´úÂëºÍMakefie , ÏÂÃæÊÇÖ÷³ÌÐò´úÂ룬
/**
* mysqlÊý¾Ý±ídump³ÌÐò
* @author : cheng limin
* @date : 2010-1-18
*
* ʹÓÃÑùÀý:
*./dump_mysql -c ../conf/dump.conf
* -t xml
* -s ......
ÔÚа²×°ºÃµÄmysql £¬apahce£¬php µÄʱºò£¬Èç¹ûÔÚ´úÂëÖÐʹÓÃÁËsessions_start() µÄʱºò»á³öÏÖÀàËÆÒÔϵĴíÎó£º
Warning: session_start() [function.session-start]: Cannot send session cooki µÈµÄ´íÎó¡£
Çë°²×°ÈçϵÄ˼·ȥÐÞÕý£º
1.ÔÚphp.ini ÖÐÅäÖÃ session.savepath='/tmp'
2.¿ªÆôsession.auto_start=1
3.°Ñ¸ü¸Ä ......