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

MySQLÊý¾Ý¿âµÄ»ù±¾²Ù×÷ÃüÁî

Ò»¡¢mysql·þÎñ²Ù×÷
1¡¢net start mysql //Æô¶¯mysql·þÎñ
2¡¢net stop mysql //Í£Ö¹mysql·þÎñ¡¡
3¡¢mysql -hÖ÷»úµØÖ· -uÓû§Ãû £­pÓû§ÃÜÂë //½øÈëmysqlÊý¾Ý¿â
4¡¢quit //Í˳ömysql²Ù×÷
5¡¢mysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë //¸ü¸ÄÃÜÂë
6¡¢grant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë" //Ôö¼ÓÐÂÓû§
exemple:
Àý2¡¢Ôö¼ÓÒ»¸öÓû§test2ÃÜÂëΪabc,ÈÃËûÖ»¿ÉÒÔÔÚlocalhostÉϵǼ£¬²¢¿ÉÒÔ¶ÔÊý¾Ý¿âmydb½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷
£¨localhostÖ¸±¾µØÖ÷»ú£¬¼´MYSQLÊý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú£©£¬ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀtest2µÄÃÜÂ룬ËûÒ²ÎÞ·¨´ÓinternetÉÏÖ±½Ó·ÃÎÊÊý¾Ý
¿â£¬Ö»ÄÜͨ¹ýMYSQLÖ÷»úÉϵÄwebÒ³À´·ÃÎÊÁË¡£
grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";
Èç¹ûÄã²»Ïëtest2ÓÐÃÜÂ룬¿ÉÒÔÔÙ´òÒ»¸öÃüÁÃÜÂëÏûµô¡£
grant select,insert,update,delete on mydb.* to test2@localhost identified by "";
¶þ¡¢Êý¾Ý¿â²Ù×÷
1¡¢show databases; //ÁгöÊý¾Ý¿â
2¡¢use database_name //ʹÓÃdatabase_nameÊý¾Ý¿â
3¡¢create database data_name //´´½¨ÃûΪdata_nameµÄÊý¾Ý¿â
4¡¢drop database data_name //ɾ³ýÒ»¸öÃûΪdata_nameµÄÊý¾Ý¿â
Èý¡¢±í²Ù×÷
1¡¢show tables //ÁгöËùÓбí
create talbe tab_name(
id int(10) not null auto_increment primary key,
name varchar(40),
pwd varchar(40)
) charset=gb2312; ´´½¨Ò»¸öÃûΪtab_nameµÄбí
2¡¢drop table tab_name ɾ³ýÃûΪtab_nameµÄÊý¾Ý±í
3¡¢describe tab_name //ÏÔʾÃûΪtab_nameµÄ±íµÄÊý¾Ý½á¹¹
4¡¢show columns from tab_name //ͬÉÏ
5¡¢delete from tab_name //½«±ítab_nameÖеļǼÇå¿Õ
6¡¢select * from tab_name //ÏÔʾ±ítab_nameÖеļǼ
7¡¢mysqldump -uUSER -pPASSWORD --no-data DATABASE TABLE > table.sql //¸´ÖƱí½á¹¹
ËÄ¡¢Ð޸ıí½á¹¹
1¡¢ ALTER TABLE tab_name ADD PRIMARY KEY (col_name)
˵Ã÷£º¸ü¸Ä±íµÃµÄ¶¨Òå°Ñij¸öÀ¸Î»ÉèΪÖ÷¼ü¡£
2¡¢ALTER TABLE tab_name DROP PRIMARY KEY (col_name)
˵Ã÷£º°ÑÖ÷¼üµÄ¶¨Òåɾ³ý
3¡¢ alter table tab_name add col_name varchar(20); //ÔÚtab_name±íÖÐÔö¼ÓÒ»¸öÃûΪcol_nameµÄ×Ö¶ÎÇÒÀàÐÍΪvarchar(20)
4¡¢alter table tab_name drop col_name //ÔÚtab_nameÖн«col_na


Ïà¹ØÎĵµ£º

ÈçºÎÐÞ¸ÄmysqlÊý¾Ý¿âµÄÁ¬½ÓÊý

а²×°ºóµÄmysqlÊý¾Ý¿â£¬ÆäĬÈϵÄ×î´óÁ¬½ÓÊýΪ100¡£
·½·¨Ò»£º
ÔÚmysql°²×°Â·¾¶Ï£¬ÕÒµ½my.ini»òÕßmy.cnfÎļþ£¬´ò¿ªËüÕÒµ½max_connections,ÉèÖóÉ1000; È»ºóÖØÆômysql·þÎñ¡£
·½·¨¶þ£º
ÔÚmysqlÔËÐл·¾³Ï£¬½øÈëmysqlÃüÁîÏ£º
mysql> set global max_connections=1000;
È»ºó¹Ø±ÕmysqlÖØÆôËü£»
ÔÚ./bin·¾¶Ï£¬Ê¹Óà # ......

MySQLµ¼³öµ¼ÈëÃüÁîµÄÓÃÀý

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

mysqlÈÕÖ¾³õ̽

mysqlÀï×î³£ÓõÄÈÕÖ¾ÓÐ4ÖÖ,·Ö±ðÊÇ:´íÎóÈÕÖ¾,¶þ½øÖÆÈÕÖ¾,²éѯÈÕÖ¾ÒÔ¼°Âú²éѯÈÕÖ¾. 1.´íÎóÈÕÖ¾»á¼Ç¼µ±mysqlÆô¶¯ºÍ¹Ø±ÕÒÔ¼°ÔËÐÐÖеĴíÎóÐÅÏ¢,¿ÉÒÔʹÓà --log-error[=file_name]À´Ö¸¶¨´íÎóÈÕÖ¾´æ·ÅÎļþ.µ±mysql serverÒì³£µÄʱºòÓ¦¸ÃÊ×ÏȲ鿴¸ÃÈÕÖ¾.ÆäʵÀïÃæÒ²Ã»Ê²Ã´,ÎÒÓ¢ÓïËļ¶Ã»¹ý,ÅäÉϴʰÔĿǰΪֹ»¹Ã»ÓÐÅöµ½½â¾ö²»Á˵ÄÎÊ ......

mysql Êý¾Ýµ¼³öµÄÁ½ÖÖ·½Ê½

MySQLÓкܶà¿ÉÒÔµ¼ÈëÊý¾ÝµÄ·½·¨£¬È»¶øÕâЩֻÊÇÊý¾Ý´«ÊäÖеÄÒ»°ë£¬ÁíÍâµÄÒ»°ãÊÇ´ÓMySQLÊý¾Ý¿âÖе¼³öÊý¾Ý¡£ÓÐÐí¶àµÄÔ­ÒòÎÒÃÇÐèÒªµ¼³öÊý¾Ý¡£Ò»¸öÖØ
ÒªµÄÔ­ÒòÊÇÓÃÓÚ±¸·ÝÊý¾Ý¿â¡£Êý¾ÝµÄÔì¼Û³£³£Êǰº¹óµÄ£¬ÐèÒª½÷É÷´¦ÀíËüÃÇ¡£¾­³£µØ±¸·Ý¿ÉÒÔ°ïÖú·ÀÖ¹±¦¹óÊý¾ÝµØ¶ªÊ§£»ÁíÍâÒ»¸öÔ­ÒòÊÇ£¬Ò²ÐíÄúÏ£Íûµ¼³öÊý¾ÝÀ´¹²
Ïí¡£ ÔÚÕâ¸öÐÅÏ¢¼¼Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ