ÔÙ̸mysqlµÄÅäÖÃÎļþmy.ini or my.cnf (Ö®¶þ)
ÈçÈôתÔØ£¬Çë×ðÖظöÈËÀͶ¯£¬Îñ±Ø×¢Ã÷Ôʼ³ö´¦£º(http://blog.csdn.net/iihero/archive/2010/05/13/5585039.aspx)
±¾ÎÄΪiihero@CSDNÔ´´¡£
ÔÚǰһƪ¶ÌÎÄÀïÌáµ½ÁËmy.ini/cnfµÄ¼ÓÔØ˳Ðò£ºC:\WINDOWS\my.cnf->C:\WINDOWS\my.ini->C:\my.cnf ->C:\my.ini ->$installdir\my.ini¡£(%MYSQL_HOME%\my.ini)-> --defaults-extra-file=path
,
(linuxÏ£¬/etc/my.cnf->/etc/mysql/my.cnf->SYSCONFDIR/my.cnf->$MYSQL_HOME/my.cnf-> --defaults-extra-file->~/my.cnf
Èç¹ûÕ⼸¸öλÖö¼ÕÒ²»µ½ÏàÓ¦ÔÅäÖÃÎļþÄØ¡£
ÄÇôһ¶¨ÊǷŵ½Ä³Ò»¸öλÖÃÁË£¬ÔÚmysql³ÌÐòÒѾÆðÀ´µÄÇé¿öÏ£¬ÈçºÎËÑÑ°Õâ¸öËùνµÄmy.ini¡£
ÔÚLinuxÏ£¬Ò»Ìõps -efÃüÁî¾ÍÄÜÕÒµ½×îÖÕʹÓõÄmy.cnfµÄÎïÀíλÖá£
ÔÚwindowsÏ£¬ÄãÓÃtasklistÃüÁîÊÇÕÒ²»³öÀ´µÄ£¬Ö»ÄÜ¿´µ½mysqld»òÕßmysql-nt½ø³ÌÃû£¬ÆäÃüÁîÐвÎÊýÔòÕÒ²»µ½¡£Ö±½Ó²é¿´services.mscҲδ±ØºÃÕÒ¡£
Õâʱºò£¬¿ÉÒÔ½èÖúÓÚרÓù¤¾ßÁË¡£
1. Èç¹ûÄãÓùýMKS toolsÖ®ÀàµÄÀàunixÃüÁîÐй¤¾ß£¬ps -ef | grep mysql¼´¿É¶¨Î»
È磺
d:\>ps -ef | grep mysql
SYSTEM 1112 764 0 04:56:49 CONIN$ 0:00 D:\mysql-5.0.9-beta-win32\bin\mysqld-nt --defaults-file=D:\mysql-5.0.9-beta-win32\bin\my.ini
mysql5
2. Èç¹ûûÓÐ1ËùÌáʾµÄ¹¤¾ß£¬Ä㻹¿ÉÒÔÏÂÔØÒ»¸öWinDbg for windows (ÕâÊÇ΢ÈíÌṩµÄÃâ·Ñ³¬Ç¿debug¹¤¾ß)£¬°ÑËüµÄ°²×°Â·¾¶ÉèÖõ½pathÀïÍ·£¬È»ºó
ÔËÐÐÃüÁîtlist -v | findstr mysql¼´¿É¡£È磺
d:\>tlist -v | findstr mysql
0 32 3240 Console.exe Title: Console - findstr mysql
0 32 1112 mysqld-nt.exe Svcs: mysql5
Command Line: D:\mysql-5.0.9-beta-win32\bin\mysqld-nt --defaults-file=D:\mysql-5.0.9-beta-win32\bin\my.ini mysql5
Command Line: findstr mysql
3. ×îºó£¬Èç¹ûÄãʵÔÚ²»Ï²»¶ÃüÁîÐУ¬ÄǾÍÓÃͼÐνçÃæºÃÁË£¬ÏÂÒ»¸öProcessExplore-NT.zip
http://technet.microsoft.com/en-us/sysinternals
--> Process Explorer
ÔËÐÐÕâ¸öͼÐνçÃæµÄ½ø³Ì¹ÜÀíÆ÷£¬
Ñ¡Ôñview->select columns£¬È»ºóÔÚprocess imageÀïÍ·£¬°ÑImage PathºÍC
Ïà¹ØÎĵµ£º
ÃüÁʽµÄ.×¢ÒâÿÐкó±ß¶¼¸ú¸ö £» ±íʾһ¸öÃüÁîÓï¾ä½áÊø.
¸ñʽ£ºgrant select on Êý¾Ý¿â.* to
Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë"
Àý1¡¢Ôö¼ÓÒ»¸öÓû§test1ÃÜÂëΪabc£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔ
rootÓû§Á¬ÈëMYSQL
£¬
È»ºó¼üÈëÒÔÏÂÃüÁ
gr ......
ÏÂÃæÏÈÀ´¿´¿´Àý×Ó£º
table
id name
1 a
2 b
3 c
4 c
5 b
¿â½á¹¹´ó¸ÅÕâÑù£¬ÕâÖ»ÊÇÒ»¸ö¼òµ¥µÄÀý×Ó£¬Êµ¼ÊÇé¿ö»á¸´Ôӵöࡣ
±ÈÈçÎÒÏëÓÃÒ»ÌõÓï¾ä²éѯµÃµ½name²»Öظ´µÄËùÓÐÊý¾Ý£¬ÄǾͱØÐëʹÓÃdistinctÈ¥µô¶àÓàµÄÖظ´¼Ç¼ ......
http://www.blogjava.net/Alpha/archive/2007/07/23/131912.html
//Ö÷¼ü549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ549830479
alter table t2 add d timestamp;
alter table infos add ex tinyint n ......
2007-11-16 15:37
½ñÌì¿´×ÅÊÖ²áÊÔÁËÏ£¬·¢ÏÖÔÀ´´óÊý¾Ýµ¼Èëµ¼³öÊÇÄÇôµÄÇáËÉ£¨²»ÊǺܴó£¬200¶àMµÄÎı¾¶øÒÔ£©
×¢Ò⣺Èç¹û·¢ÏÖMYSQL unknown command '\'ÕâÑùµÄÌáʾ£¬ÔòÉèÖÃһϷþÎñÆ÷µÄ×Ö·û¼¯£¬È磺
mysql -uroot -ppasspass --default-character-set=utf8 databaseName <d:bakcup.sql
ÕâÑù¾Í²»»á±¨´íÁË£¬^_^
µ¼³ö ......
use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
Ê×ÏÈÒªÉùÃ÷Ò»µã£¬´ó²¿·ÖÇé¿öÏ£¬ÐÞ¸ÄMySQLÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ģ¬
ËùÒÔÒ»°ãÓû§ÎÞ·¨¸ü¸ÄÃÜÂ룬³ý·ÇÇëÇó¹ÜÀíÔ±¡£
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµ ......