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

mysqlÃüÁ½õ

mysql
ÃüÁ½õ
²âÊÔ»·¾³£ºmysql 5.0.45
¡¾×¢£º¿ÉÒÔÔÚmysql
ÖÐͨ¹ýmysql>
SELECT VERSION();
À´²é¿´Êý¾Ý¿â°æ±¾¡¿

Ò»¡¢Á¬½ÓMYSQL
¡£

¸ñʽ£º mysql -h
Ö÷»úµØÖ· -u
̞
£­p
Óû§ÃÜÂë
1
¡¢Á¬½Óµ½±¾»úÉϵÄMYSQL
¡£

Ê×ÏÈ´ò¿ªDOS
´°¿Ú£¬È»ºó½øÈëĿ¼mysql\bin
£¬ÔÙ¼üÈëÃüÁîmysql -u root -p
£¬»Ø³µºóÌáʾÄãÊäÃÜÂë.
×¢ÒâÓû§ÃûÇ°¿ÉÒÔÓпոñÒ²¿ÉÒÔûÓпոñ£¬µ«ÊÇÃÜÂëÇ°±ØÐëûÓпոñ£¬·ñÔòÈÃÄãÖØÐÂÊäÈëÃÜÂë.

Èç¹û¸Õ°²×°ºÃMYSQL
£¬³¬¼¶Óû§root
ÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQL
ÖÐÁË£¬MYSQL
µÄÌáʾ·ûÊÇ£º mysql>
2
¡¢Á¬½Óµ½Ô¶³ÌÖ÷»úÉϵÄMYSQL
¡£¼ÙÉèÔ¶³ÌÖ÷»úµÄIP
Ϊ£º110.110.110.110
£¬Óû§ÃûΪroot,
ÃÜÂëΪabcd123
¡£Ôò¼üÈëÒÔÏÂÃüÁ
mysql -h110.110.110.110 -u root -p 123;
£¨×¢:u
Óëroot
Ö®¼ä¿ÉÒÔ²»Óüӿոñ£¬ÆäËüÒ²Ò»Ñù£©
3
¡¢Í˳öMYSQL
ÃüÁ exit
£¨»Ø³µ£©

¶þ¡¢ÐÞ¸ÄÃÜÂë¡£

¸ñʽ£ºmysqladmin -u
̞ -p
¾ÉÃÜÂë password
ÐÂÃÜÂë
1
¡¢¸øroot
¼Ó¸öÃÜÂëab12
¡£Ê×ÏÈÔÚDOS
ϽøÈëĿ¼mysql\bin
£¬È»ºó¼üÈëÒÔÏÂÃüÁî
mysqladmin -u root -password ab12

×¢£ºÒòΪ¿ªÊ¼Ê±root
ûÓÐÃÜÂ룬ËùÒÔ-p
¾ÉÃÜÂëÒ»Ïî¾Í¿ÉÒÔÊ¡ÂÔÁË¡£
2
¡¢ÔÙ½«root
µÄÃÜÂë¸ÄΪdjg345
¡£
mysqladmin -u root -p ab12 password djg345

Èý¡¢Ôö¼ÓÐÂÓû§¡£

£¨×¢Ò⣺ºÍÉÏÃ治ͬ£¬ÏÂÃæµÄÒòΪÊÇMYSQL
»·¾³ÖеÄÃüÁËùÒÔºóÃ涼´øÒ»¸ö·ÖºÅ×÷ΪÃüÁî½áÊø·û£©

¸ñʽ£ºgrant select on
Êý¾Ý¿â.* to
̞@
µÇ¼Ö÷»ú identified by “
ÃÜÂë”
1
¡¢Ôö¼ÓÒ»¸öÓû§test1
ÃÜÂëΪabc
£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃroot
Óû§Á¬ÈëMYSQL
£¬È»ºó¼üÈëÒÔÏÂÃüÁ
grant select,insert,update,delete on *.* to [email=test1@”%]test1@”%[/email]”
Identified by “abc”;

µ«Ôö¼ÓµÄÓû§ÊÇÊ®·ÖΣÏյģ¬ÄãÏëÈçij¸öÈËÖªµÀtest1
µÄÃÜÂ룬ÄÇôËû¾Í¿ÉÒÔÔÚinternet
ÉϵÄÈκÎһ̨µçÄÔÉϵǼÄãµÄmysql
Êý¾Ý¿â²¢¶ÔÄãµÄÊý¾Ý¿ÉÒÔΪËùÓûΪÁË£¬½â¾ö°ì·¨¼û2
¡£
2
¡¢Ôö¼ÓÒ»¸öÓû§test2
ÃÜÂëΪabc,
ÈÃËûÖ»¿ÉÒÔÔÚlocalhost
ÉϵǼ£¬²¢¿ÉÒÔ¶ÔÊý¾Ý¿âmydb
½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhost
Ö¸±¾µØÖ÷»ú£¬¼´MYSQL
Êý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú


Ïà¹ØÎĵµ£º

MYSQLÖ÷¼ü×Ô¶¯Ôö¼ÓµÄÅäÖÃ

ÔÚÊý¾Ý¿âÓ¦Óã¬ÎÒÃǾ­³£ÒªÓõ½Î¨Ò»±àºÅ¡£ÔÚMySQLÖпÉͨ¹ý×ֶεÄAUTO_INCREMENTÊôÐÔÀ´×Ô¶¯Éú³É¡£MySQLÖ§³Ö¶àÖÖÊý¾Ý±í£¬Ã¿ÖÖÊý¾Ý±íµÄ×ÔÔöÊôÐÔ¶¼ÓÐËù²»Í¬¡£
ISAM±í
Èç¹û°ÑÒ»¸öNULL²åÈëµ½Ò»¸öAUTO_INCREMENTÊý¾ÝÁÐÀïÈ¥£¬MySQL½«×Ô¶¯Éú³ÉÏÂÒ»¸öÐòÁбàºÅ¡£±àºÅ´Ó1¿ªÊ¼£¬²¢1Ϊ»ùÊýµÝÔö¡£
µ±²åÈë¼Ç¼ʱ£¬Ã»ÓÐΪAUTO_INCREMENTÃ÷È ......

mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ

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 ......

mysql ÐÞ¸ÄÃÜÂë

use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
Ê×ÏÈÒªÉùÃ÷Ò»µã£¬´ó²¿·ÖÇé¿öÏ£¬ÐÞ¸ÄMySQLÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ģ¬
ËùÒÔÒ»°ãÓû§ÎÞ·¨¸ü¸ÄÃÜÂ룬³ý·ÇÇëÇó¹ÜÀíÔ±¡£
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµ ......

ÔÙ̸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)-> ......

Mysql ÈÕÆÚºÍʱ¼äת»»º¯Êý´óÈ«

¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) select DAYOFWEEK('1998-02-03');
-&g ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ