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

MySqlÃüÁî´óÈ«

1. Á¬½Ómysql:
mysqlbinmysql -hÖ÷»úµØÖ· -u Óû§Ãû £­p Óû§ÃÜÂë
2.Í˳ömysql:exit
3. ÐÞ¸ÄÃÜÂë:
mysqlbinmysqladmin -uroot -p(oldpassword) password newpassword
4.Ôö¼ÓÓû§£º
Ìí¼ÓÒ»¸öÓû§test1 ÃÜÂëΪABC£»ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ,²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬Èë
mysql,È»ºó¼üÈëÒÔÏÂÃüÁgrant select,insert,update,delete on *.* to test1@"%" Identified
by "abc";
Ôö¼ÓÒ»¸öÓû§test2ÃÜÂëΪabc,ÈÃÆäÖ»¿ÉÒÔÔÚlocalhostÉϵǼ,²¢¿ÉÒÔ¶ÔÊý¾Ý¿âmydb½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhostÖ¸±¾µØ
Ö÷»ú,¼´mysqlÊý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú£©,ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀtest2µÄÃÜÂ룬ҲÎÞ·¨´ÓinternetÉÏÖ±½Ó·ÃÎÊÊý¾Ý¿â,Ö»ÄÜͨ¹ýmysqlÖ÷»úÉϵÄwebÒ³
À´·ÃÎÊÁË¡£grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";
Ôö¼ÓÒ»¸ö¿ÉÒÔ´ÓÈκεط½Á¬½Ó·þÎñÆ÷µÄÒ»¸öÍêÈ«µÄ³¬¼¶Óû§
grant all privileges on *.* to test3@"%" identified by 'password' with grant option;
5.ɾ³ýÊÚȨ
revoke select,insert,update,delete om *.* from test2@localhost ;
--------------------------------------------------------
6.ÏÔʾÊý¾Ý¿â
show databases;
7.ÏÔʾÊý¾Ý¿âÖеıí
use dataname£»
show tables£»
8.ÏÔʾ±íµÄ½á¹¹
describe tablesname;
9.½¨¿â
create database ¿âÃû;
10.½¨±í
use dataname;
create table teacher //½¨Á¢±íTEACHER
(
id int(3) auto_increment not null primary key,
name char(10) not null,
address varchar(50) default 'ÉîÛÚ',
year date
); //½¨±í½áÊø
//ÒÔÏÂΪ²åÈë×Ö¶Î
insert into teacher values('','glchengang','ÉîÛÚÒ»ÖÐ','1976-10-10');
insert into teacher values('','jack','ÉîÛÚÒ»ÖÐ','1975-12-23');
×¢£ºÔÚ½¨±íÖÐ
(1) ½«IDÉèΪ³¤¶ÈΪ3µÄÊý×Ö×Ö¶Î:int(3)£¬²¢ÈÃËüÿ¸ö¼Ç¼×Ô¶¯¼ÓÒ»: auto_increment£¬
²¢²»ÄÜΪ¿Õ:not null£¬¶øÇÒÈÃËü³ÉΪÖ÷×Ö¶Îprimary key
(2) ½«NAMEÉèΪ³¤¶ÈΪ10µÄ×Ö·û×Ö¶Î
(3) ½«ADDRESSÉèΪ³¤¶È50µÄ×Ö·û×ֶΣ¬¶øÇÒȱʡֵΪÉîÛÚ¡£varcharºÍcharÓÐʲôÇø±ð
ÄØ£¬Ö»ÓеÈÒÔºóµÄÎÄÕÂÔÙ˵ÁË¡£
(4) ½«YEARÉèΪÈÕÆÚ×ֶΡ£
Èç¹ûÄãÔÚmysqlÌáʾ·û¼üÈëÉÏÃæµÄÃüÁîÒ²¿ÉÒÔ£¬µ«²»·½±ãµ÷ÊÔ¡£ Äã¿ÉÒÔ½«ÒÔÉÏÃüÁî
Ô­ÑùдÈëÒ»¸öÎı¾ÎļþÖмÙÉèΪschool.sql£¬È»ºó¸´ÖƵ½c:Ï£¬²¢ÔÚDOS״̬½øÈëĿ¼
mysql in£¬


Ïà¹ØÎĵµ£º

oracleºÍmysqlÈÕÆÚº¯Êý¶Ô±È

MySQLÈÕÆÚ×ֶηÖDateºÍTimeÁ½ÖÖ£¬oracleÈÕÆÚ×Ö¶ÎÖ»ÓÐDate£¬°üº¬ÄêÔÂÈÕʱ·ÖÃëÐÅÏ¢£¬Óõ±Ç°Êý¾Ý¿âµÄϵͳʱ¼äΪsysdate,¾«È·µ½Ã룬»òÕßÓÃ×Ö·û´®×ª»»ÈÕÆÚÐͺ¯Êý£º
 
    To_date('2001-08-01','YYYY-MM-DD'); Äê-ÔÂ-ÈÕ
    24Сʱ£º·ÖÖÓ£ºÃëµÄ¸ñʽ  'YYYY-MM-DD HH24:MI:SS'  ......

MySQL·ÖÇø£¨Partition£©

MySQL·ÖÇø£¨Partition£©¹¦ÄÜÊÔÑé2008-07-06 20:02Ŀ¼
[¸ÅÊö]
[·ÖÇø±íºÍδ·ÖÇø±íÊÔÑé¹ý³Ì]
[·ÖÇøÃüÁîÏê½â]
[¸ÅÊö]
×Ô5.1¿ªÊ¼¶Ô·ÖÇø(Partition)ÓÐÖ§³Ö£¬6.0Ó¦±È½ÏÎȶ¨
= ˮƽ·ÖÇø£¨¸ù¾ÝÁÐÊôÐÔ°´Ðз֣©=
¾Ù¸ö¼òµ¥Àý×Ó£ºÒ»¸ö°üº¬Ê®Ä귢Ʊ¼Ç¼µÄ±í¿ÉÒÔ±»·ÖÇøΪʮ¸ö²»Í¬µÄ·ÖÇø£¬Ã¿¸ö·ÖÇø°üº¬µÄÊÇÆäÖÐÒ»ÄêµÄ¼Ç¼¡£
=== Ë® ......

OracleºÍMySQLÊý¾Ý¿âµÄһЩ¼òµ¥ÃüÁî¶Ô±È

ÒÔÏÂΪOracleºÍMySQLÊý¾Ý¿âµÄһЩ¼òµ¥ÃüÁî¶Ô±È£¬¿´¿´ËüÃÇÖ®¼ä´æÔÚÄÄЩ²îÒì
¡¡¡¡SQL> select to_char(sysdate,'yyyy-mm-dd') from dual;
¡¡¡¡SQL> select to_char(sysdate,'hh24-mi-ss') from dual;
¡¡¡¡mysql> select date_format(now(),'%Y-%m-%d');
¡¡¡¡mysql> select time_format(now(),'%H-%i-%S');
¡¡¡¡ÈÕÆÚº ......

²é¿´MySQL¼Ç¼ִÐйýµÄSQL

µÚÒ»ÖÖ:²éSlow queryµÄSQLÓï·¨:
 
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2 (³¬¹ý2ÃëµÄSQLÓï·¨¼Ç¼ÆðÀ´,Éè¶ÌÒ»µãÀ´¼Ç¼³ý´íÒ²ÊÇÒ»ÖÖ·½·¨.)
 
µÚ¶þÖÖ:ÉèMySQL ReplicationÓÃbinlog:
 
log_bin = /var/log/mysql/mysql-bin.log (´ËµµÒªÓÃmysqlbinlog½âÀ´¿´£¬
mysqlbinl ......

´î½¨JSP ×éºÏMyEclipse£«MySQL£«Tomcat¿ª·¢»·¾³

Ò»¡¢°²×°JDK ¡¡¡¡Ê×ÏÈÏÂÔØJDK 5.0£¨JDK 5.0µÄÏÂÔØÒ³ÃæΪ£ºhttp://java.sun.com/j2se/1.5.0/download.jsp£©£» È»ºóÔËÐÐJDK 5.0°²×°³ÌÐòjdk-1_5_0_06-windows-i586-p.exe£¬°²×°¹ý³ÌÖÐËùÓÐÑ¡Ïî±£³ÖĬÈÏ£»×îºóÅäÖÃJDKµÄ»·¾³±äÁ¿£ºÔÚ“ÎҵĵçÄÔ”ÉϵãÓÒ¼ü—>“ÊôÐÔ”—>“¸ß¼¶”& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ