ysqlĬÈÏÊDz»ÔÊÐíÔ¶³ÌÁ¬½ÓµÄ£¬ÒòΪÓкܴóµÄ°²È«Òþ»¼¡£
¡¡¡¡ÐèÒªÊÖ¶¯Ôö¼Ó¿ÉÒÔÔ¶³Ì·ÃÎÊÊý¾Ý¿âµÄÓû§¡£
¡¡¡¡·½·¨Ò»¡¢±¾µØµÇÈëmysql£¬¸ü¸Ä "mysql" Êý¾Ý¿âÀïµÄ "user" ±íÀïµÄ "host" Ï½«"localhost"¸ÄΪ"%"
#mysql -u root -proot
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
¡¡¡¡·½·¨¶þ¡¢Ö±½ÓÊÚȨ(ÍƼö)
¡¡¡¡´ÓÈκÎÖ÷»úÉÏʹÓÃrootÓû§£¬ÃÜÂ룺youpassword£¨ÄãµÄrootÃÜÂ룩Á¬½Óµ½mysql·þÎñÆ÷£º
# mysql -u root -proot
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
¡¡¡¡ÔÊÐíµØÖ·202.11.10.253ÉÏÓÃrootÓû§£¬ÃÜÂëdboomysqlÀ´Á¬½ÓmysqlµÄËùÓÐÊý¾Ý¿â£¬¸¶¸øselect,insert,update,deleteȨÏÞ¡£
# mysql -u root -proot
grant select,insert,update,delete on *.* to root@"202.11.10.253" Identified by "dboomysql";
¡¡¡¡ÔÊÐíµØÖ·202.11.10.253ÉÏÓÃrootÓû§£¬ÃÜÂëdboomysqlÀ´Á¬½ÓmysqlµÄËùÓÐÊý¾Ý¿â£¬¸¶¸øËùÓÐȨÏÞ¡£
# mysql -u root -proot
grant all on *.* to root@"202.11.10.253" Identified by "dboomysql"
¡¡¡¡ÖØÆôMy ......
Ò» . °²×°ÓëÅäÖÃMYSQL
¶þ . ³£ÓÃmysqlÃüÁîÐÐÃüÁî
1 .mysqlµÄÆô¶¯ÓëÍ£Ö¹
Æô¶¯MYSQL·þÎñ net start mysql
Í£Ö¹MYSQL·þÎñ net stop mysql
2 . netstat –na | findstr 3306 ²é¿´±»¼àÌýµÄ¶Ë¿Ú , findstrÓÃÓÚ²éÕÒºóÃæµÄ¶Ë¿ÚÊÇ·ñ´æÔÚ
3 . ÔÚÃüÁîÐÐÖеǽMYSQL¿ØÖÆ̨ , ¼´Ê¹Óà MYSQL COMMEND LINE TOOL
Óï·¨¸ñʽ mysql –user=root –password=123456 db_name
»ò mysql –u root –p123456 db_name
4 . ½øÈëMYSQLÃüÁîÐй¤¾ßºó , ʹÓÃstatus; »ò\s ²é¿´ÔËÐл·¾³ÐÅÏ¢
5 . Çл»Á¬½ÓÊý¾Ý¿âµÄÓï·¨ : use new_dbname;
6 . ÏÔʾËùÓÐÊý¾Ý¿â : show databases;
7 . ÏÔʾÊý¾Ý¿âÖеÄËùÓбí : show tables;
8 . ÏÔʾij¸ö±í´´½¨Ê±µÄÈ«²¿ÐÅÏ¢ : show create table table_name;
9 . ²é¿´±íµÄ¾ßÌåÊôÐÔÐÅÏ¢¼°±íÖи÷×ֶεÄÃèÊö
Describe table_name; ËõдÐÎʽ : desc table_name;
Èý ¡£ MySqlÖеÄSQLÓï¾ä
1 . Êý¾Ý¿â´´½¨ : Create database db_name;
Êý¾Ý¿âɾ³ý : Drop database db_name; ɾ³ýʱ¿ÉÏÈÅжÏÊÇ·ñ´æÔÚ£¬Ð´³É : drop database if exits db_name
2 . ½¨±í : ´´½¨Êý¾Ý±íµÄÓï·¨ : creat ......
»ùÓÚMySQLºÍInfobrightµÄÊý¾Ý²Ö¿â¼¼Êõ
Êý¾Ý²Ö¿â/·ÖÎö/ÉÌÎñÖÇÄÜ( BI )ÁìÓòÕýÔÚ·ÉËÙ·¢Õ¹¡£ÔÚ¼¤Áҵľ¼Ã¾ºÕùÖÐËùÓÐÐÐÒµºÍÖÇÄÜÆóÒµÐèÒªÀûÓÃÆäÄÚ²¿µÄÊý¾ÝÀ´×ö³öÖØÒªµÄÉÌÒµ¾ö²ß£¬°üÀ¨Õ½ÊõºÍÕ½ÂÔÁ½·½Ã棬ÒÔ±£³ÖÐÐÒµµÄÁìÏȵØλ¡£
Êý¾Ý²Ö¿â(Èç¶ÔMySQLµÄÒ»´ÎÖØ´óÉç»áºÍ¿Í»§µ÷²é)Ä¿Ç°ÊÇMySQLµÄµÚÎåÖÖ×î³£¼ûµÄÓ¦Óá£ÏÖÔÚÓÃÓÚMySQLÊý¾Ý²Ö¿â×îÁ÷ÐеĴ洢ÒýÇæÊÇMyISAM (µÚ¶þ¸öÊÇInnoDBµÄ) £¬µ±Êý¾Ý´ïµ½1TB×óÓÒÊÇËûµÄÐÔÄÜÒÀÈ»ºÜÓÅÔ½¡£ÔÚ´ËÖ®ºó£¬´óÁ¿µÄÓû§ÍùÍù½«Êý¾Ý²Ö¿â·Ö²¼ÔÚ¶à¸ö·þÎñÆ÷£¬ÒÔÌá¸ßÐÔÄÜ¡£ÏÖÔÚ£¬´Ó·ÖÎö¹«Ë¾IDCͳ¼Æ×ÊÁÏÀ´¿´£¬´ó¶àÊýµÄÊý¾Ý²Ö¿âÊÇ6TBÏÂ(¾ÝIDC³ÆÖ»ÓÐ4 %³¬¹ý25TB)£¬Òò´ËÕâÒâζ×Å´ó¶àÊýÈ˳ÉÌ춼ֻÔÚ¹ÜÀíÊý°ÙGBºÍ6TBÖ®¼äµÄÊý¾Ý²Ö¿â¡£
MySQLµÄÊý¾Ý²Ö¿âÒýÇæInfoBright, infobright£¬Ò»¸ö»ùÓÚmysqlµÄÊý¾Ý²Ö¿âϵͳʵÏÖ£¬ËüÒѾÊǺܶ࿪Դ»òÉÌÓÃBIϵͳµÄµ×²ã´æ´¢ÒýÇæ¡£
²»Í¬ÓÚÒ»°ãµÄÊý¾Ý¿â£¬ICEµÄMySQLÒýÇæÊÇÁÐʽ´æ´¢£¬Ò»°ãµÄÊý¾Ý¿âÊÇÐÐʽ´æ´¢£¬ÕâÑùµÄºÃ´¦ÊÇ£¬°´Ä³×Ö¶ÎÄÚÈÝ×ö²éѯÌõ¼þ£¬²éѯÏ൱ÓÚÈ¡Õâ¸ö±íÖÐijһÁУ¬Ð§ÂʿɼûÒ»°ß¡£
ÓÉÓÚÊÇ·ÖÎöÐÍOLAPÊý¾Ý¿â£¬ ²»Ö§³Öinsert¡¢update¡¢deleteµÈ²Ù×÷£¬Ò²Ã»ÓÐÖ÷¼ü£¬Êý¾ÝÖ»ÄÜload infile½øÈ¥. ѹËõ±È¸ß´ï1/4
×îºó×î¹ØÐ ......
Link from : http://www.5ilinux.com/blog/archives/000091.html
1.Ê×ÏÈÎÒÃǽ¨Á¢ÏàÓ¦µÄÓû§ºÍÓû§×é
groupadd -g 5500 ftpgroup
adduser -u 5500 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser
2.²Ù×÷Êý¾Ý¿â
mysql mysql -uroot -ppassword
create database ftpdb
grant select, update on ftpdb.* to proftpd@localhost identified by 'password'use ftpdb
CREATE TABLE `ftpgroup` (
`groupname` varchar(16) NOT NULL default '',
`gid` smallint(6) NOT NULL default '5500',
`members` varchar(16) NOT NULL default '',
KEY `groupname` (`groupname`)
) TYPE=MyISAM COMMENT='ProFTP group table';
INSERT INTO `ftpgroup` VALUES ('ftpgroup', 5500, 'ftpuser');
CREATE TABLE `ftpquotalimits` (
`name` varchar(30) default NULL,
`quota_type` enum('user','group','class','all') NOT NULL default 'user',
`per_session` enum('false','true') NOT NULL default 'false',
`limit_type` enum('soft','hard') NOT NULL default 'soft',
`bytes_in_avail` float NOT NULL default '0',
`bytes_out_avail` floa ......
¹«Ë¾µÄ·þÎñÆ÷ÊÇCentOS 5.4(Final)°æµÄ£¬½ñÌìÔÚÉÏÃæ°²×°ÁËÒ»»Ømysql5.5£¬¼Ç¼ÈçÏ£º
1¡¢´Óhttp://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.5.2-m2.tar.gz ÏÂÔØÔ´Âë°²×°°üµ½/usr/local/src
2¡¢tar zxvf mysql-5.5.2-m2.tar.gz ½âѹµ½/usr/local/src/mysql-5.5.2-m2ÏÂ
cd mysql-5.5.2-m2/
./configure --prefix=/home/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
£¨ÔÚÁíÍâһ̨·þÎñÆ÷°²×°Ê±£¬³öÏÖconfigure: error: No curses/termcap library found´íÎ󣬼ÓÉÏ--with-named-curses-libs=/usr/lib/libncursesw.so.5²ÎÊý¿ÉÒÔ½â¾ö£¬»òÕßÔÙÓÃyum°²×°ncurses-develÒ²¿É£©
make
make install
ÔÚmake installµÄºó°ë¹ý³Ì£¬ÓÐÒ»¶Î±È½Ï³¤Ê±¼äµÄÍ£¶Ù£¬²»Òªµ£ÐÄËÀµôÁË£¬Êµ¼ÊÉÏËü»¹»î×Å£¬ÄÍÐĵĵȴý£¬×îÖջᰲװÍê±Ï¡£
3¡¢Èç¹û»¹Ã»ÓÐmysqlÓû§£¬´´½¨£º
&n ......
¹«Ë¾µÄ·þÎñÆ÷ÊÇCentOS 5.4(Final)°æµÄ£¬½ñÌìÔÚÉÏÃæ°²×°ÁËÒ»»Ømysql5.5£¬¼Ç¼ÈçÏ£º
1¡¢´Óhttp://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.5.2-m2.tar.gz ÏÂÔØÔ´Âë°²×°°üµ½/usr/local/src
2¡¢tar zxvf mysql-5.5.2-m2.tar.gz ½âѹµ½/usr/local/src/mysql-5.5.2-m2ÏÂ
cd mysql-5.5.2-m2/
./configure --prefix=/home/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
£¨ÔÚÁíÍâһ̨·þÎñÆ÷°²×°Ê±£¬³öÏÖconfigure: error: No curses/termcap library found´íÎ󣬼ÓÉÏ--with-named-curses-libs=/usr/lib/libncursesw.so.5²ÎÊý¿ÉÒÔ½â¾ö£¬»òÕßÔÙÓÃyum°²×°ncurses-develÒ²¿É£©
make
make install
ÔÚmake installµÄºó°ë¹ý³Ì£¬ÓÐÒ»¶Î±È½Ï³¤Ê±¼äµÄÍ£¶Ù£¬²»Òªµ£ÐÄËÀµôÁË£¬Êµ¼ÊÉÏËü»¹»î×Å£¬ÄÍÐĵĵȴý£¬×îÖջᰲװÍê±Ï¡£
3¡¢Èç¹û»¹Ã»ÓÐmysqlÓû§£¬´´½¨£º
&n ......
SOURCE: CLICK HERE
±¾ÎĽ²ÊöSQL Server¡¢Oracle¡¢MySQL²é³öֵΪNULLµÄÌæ»»¡£
ÔÚSQL Server Oracle MySQLµ±Êý¾Ý¿âÖвé³öijֵΪNULLÔõô°ì?
1¡¢MSSQL: ISNULL()
Óï·¨
ISNULL ( check_expression , replacement_value )
²ÎÊý
check_expression
½«±»¼ì²éÊÇ·ñΪ NULLµÄ±í´ïʽ¡£check_expression ¿ÉÒÔÊÇÈκÎÀàÐ͵ġ£
replacement_value
ÔÚ check_expression Ϊ NULLʱ½«·µ»ØµÄ±í´ïʽ¡£replacement_value ±ØÐëÓë check_expresssion ¾ßÓÐÏàͬµÄÀàÐÍ¡£
·µ»ØÀàÐÍ
·µ»ØÓë check_expression ÏàͬµÄÀàÐÍ¡£
×¢ÊÍ
Èç¹û check_expression ²»Îª NULL£¬ÄÇô·µ»Ø¸Ã±í´ïʽµÄÖµ£»·ñÔò·µ»Ø replacement_value¡£
2¡¢Oracle: NVL()
Óï·¨
NVL(eExpression1, eExpression2)
²ÎÊý
eExpression1, eExpression2
Èç¹û eExpression1 µÄ¼ÆËã½á¹ûΪ null Öµ£¬Ôò NVL() ·µ»Ø eExpression2¡£Èç¹û eExpression1 µÄ¼ÆËã½á¹û²»ÊÇ null Öµ£¬Ôò·µ»Ø eExpression1¡£eExpression1 ºÍ eExpression2 ¿ÉÒÔÊÇÈÎÒâÒ»ÖÖÊý¾ÝÀàÐÍ¡£Èç¹û eExpression1 Óë eExpression2 µÄ½á¹û½ÔΪ null Öµ£¬Ôò NVL( ) ·µ»Ø NULL
·µ»ØÖµÀàÐÍ
×Ö·ûÐÍ¡¢ÈÕÆÚÐÍ¡¢ÈÕÆÚʱ¼äÐÍ¡¢ÊýÖµÐÍ¡¢»õ±ÒÐÍ¡¢Âß¼ÐÍ»ò null Öµ
˵Ã÷
ÔÚ²»Ö§³Ö ......
SOURCE: CLICK HERE
±¾ÎĽ²ÊöSQL Server¡¢Oracle¡¢MySQL²é³öֵΪNULLµÄÌæ»»¡£
ÔÚSQL Server Oracle MySQLµ±Êý¾Ý¿âÖвé³öijֵΪNULLÔõô°ì?
1¡¢MSSQL: ISNULL()
Óï·¨
ISNULL ( check_expression , replacement_value )
²ÎÊý
check_expression
½«±»¼ì²éÊÇ·ñΪ NULLµÄ±í´ïʽ¡£check_expression ¿ÉÒÔÊÇÈκÎÀàÐ͵ġ£
replacement_value
ÔÚ check_expression Ϊ NULLʱ½«·µ»ØµÄ±í´ïʽ¡£replacement_value ±ØÐëÓë check_expresssion ¾ßÓÐÏàͬµÄÀàÐÍ¡£
·µ»ØÀàÐÍ
·µ»ØÓë check_expression ÏàͬµÄÀàÐÍ¡£
×¢ÊÍ
Èç¹û check_expression ²»Îª NULL£¬ÄÇô·µ»Ø¸Ã±í´ïʽµÄÖµ£»·ñÔò·µ»Ø replacement_value¡£
2¡¢Oracle: NVL()
Óï·¨
NVL(eExpression1, eExpression2)
²ÎÊý
eExpression1, eExpression2
Èç¹û eExpression1 µÄ¼ÆËã½á¹ûΪ null Öµ£¬Ôò NVL() ·µ»Ø eExpression2¡£Èç¹û eExpression1 µÄ¼ÆËã½á¹û²»ÊÇ null Öµ£¬Ôò·µ»Ø eExpression1¡£eExpression1 ºÍ eExpression2 ¿ÉÒÔÊÇÈÎÒâÒ»ÖÖÊý¾ÝÀàÐÍ¡£Èç¹û eExpression1 Óë eExpression2 µÄ½á¹û½ÔΪ null Öµ£¬Ôò NVL( ) ·µ»Ø NULL
·µ»ØÖµÀàÐÍ
×Ö·ûÐÍ¡¢ÈÕÆÚÐÍ¡¢ÈÕÆÚʱ¼äÐÍ¡¢ÊýÖµÐÍ¡¢»õ±ÒÐÍ¡¢Âß¼ÐÍ»ò null Öµ
˵Ã÷
ÔÚ²»Ö§³Ö ......
SOURCE: CLICK HERE
±¾ÎĽ²ÊöSQL Server¡¢Oracle¡¢MySQL²é³öֵΪNULLµÄÌæ»»¡£
ÔÚSQL Server Oracle MySQLµ±Êý¾Ý¿âÖвé³öijֵΪNULLÔõô°ì?
1¡¢MSSQL: ISNULL()
Óï·¨
ISNULL ( check_expression , replacement_value )
²ÎÊý
check_expression
½«±»¼ì²éÊÇ·ñΪ NULLµÄ±í´ïʽ¡£check_expression ¿ÉÒÔÊÇÈκÎÀàÐ͵ġ£
replacement_value
ÔÚ check_expression Ϊ NULLʱ½«·µ»ØµÄ±í´ïʽ¡£replacement_value ±ØÐëÓë check_expresssion ¾ßÓÐÏàͬµÄÀàÐÍ¡£
·µ»ØÀàÐÍ
·µ»ØÓë check_expression ÏàͬµÄÀàÐÍ¡£
×¢ÊÍ
Èç¹û check_expression ²»Îª NULL£¬ÄÇô·µ»Ø¸Ã±í´ïʽµÄÖµ£»·ñÔò·µ»Ø replacement_value¡£
2¡¢Oracle: NVL()
Óï·¨
NVL(eExpression1, eExpression2)
²ÎÊý
eExpression1, eExpression2
Èç¹û eExpression1 µÄ¼ÆËã½á¹ûΪ null Öµ£¬Ôò NVL() ·µ»Ø eExpression2¡£Èç¹û eExpression1 µÄ¼ÆËã½á¹û²»ÊÇ null Öµ£¬Ôò·µ»Ø eExpression1¡£eExpression1 ºÍ eExpression2 ¿ÉÒÔÊÇÈÎÒâÒ»ÖÖÊý¾ÝÀàÐÍ¡£Èç¹û eExpression1 Óë eExpression2 µÄ½á¹û½ÔΪ null Öµ£¬Ôò NVL( ) ·µ»Ø NULL
·µ»ØÖµÀàÐÍ
×Ö·ûÐÍ¡¢ÈÕÆÚÐÍ¡¢ÈÕÆÚʱ¼äÐÍ¡¢ÊýÖµÐÍ¡¢»õ±ÒÐÍ¡¢Âß¼ÐÍ»ò null Öµ
˵Ã÷
ÔÚ²»Ö§³Ö ......