MySQLÃüÁî
1. Á¬½Ómysql:
mysql -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£¬È»ºó¼üÈëÒÔÏÂÃüÁî
Ïà¹ØÎĵµ£º
http://dev.mysql.com/doc/refman/5.1/zh/index.html
(MySql 5.1 ÖÐÎIJο¼ÊÖ²á)
*------------------------------------------------------------------------------------------
show databases; ÏÔʾÊý¾Ý¿â
drop database Êý¾Ý¿âÃû;ɾ³ýÊý¾Ý¿â
set names 'utf8';ÉèÖÃÊý¾Ý¿â±àÂëΪutf-8
source x:\Êý¾Ý¿âÃû.sql;µ¼È ......
MySQL ClusterÅäÖÃstep by step
À´Ô´£ºhttp://space.itpub.net/15415488/viewspace-620903
¹«Ë¾ÓиöÏîÄ¿ÊDzâÊÔdistributed DB£¬ÆäÖÐÒ»ÏîÊÇÕë¶ÔMySQL ClusterµÄ²âÊÔ¡£
ÓÚÊÇ»¨ÁËÁ½Ììʱ¼ä×°»úÆ÷ºÍÅäÖÃMySQL Cluster¡£Õû¸ö¹ý³Ì»¹ÊDZȽÏ˳ÀûµÄ£¬µ±È»Èç¹û¶ÔMySQL³£ÓÃÃüÁî±È½ÏÊìϤµÄ»°»á¸ü˳Àû¡£
ÁôÏÂstep by stepÅä ......
<! -- beans ÔªËØÊÇSpringÅäÖÃÎļþµÄ¸ùÔªËØ£¬ËùÓеÄSpring µÄÅäÖÃÎļþ¶¼Ó¦°´ÈçϽṹÊéдһ¡µ
<beans>
<!Ò»ÅäÖÃid ΪdataSource µÄbean£¬¸Ãbean ÊǸöÊý¾ÝԴʵÀýÒ»¡µ
<bean ¹¤d="dataSource" class="org.apache.corrunons.dbcp.BasicDataSource"
destroy-method="close">
<! È·¶¨Êý¾ÝÔ´µÄÇ ......
//µÃ·Ö¼ÆËãËÄÉáÎåÈë
SELECT ROUND((SUM(getfeng)/SUM(totalfeng))*100) as feng from answerdata WHERE uid='151' AND targetid IS NOT NULL
1.ceil £¨£© /ceiling£¨£© ÏòÉÏÈ¡Õû
Àý£º ceil£¨1.2£© = 2
2.floor £¨£© ÏòÏÂÈ¡Õû
Àý£º floor£¨1.2£© = 1
3.round£¨£© ËÄÉáÎåÈë
&n ......