Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

MySQLµÄÃÜÂëÉèÖÃ

http://www.3d308.cn/article.asp?id=37
shell> mysql -u root mysql
mysql> Update user SET Password=PASSWORD('new_password')
           Where user='root';
mysql> FLUSH PRIVILEGES;
ÔÚMySQL 3.22ºÍÒÔÉϰ汾ÖУ¬Äã¿ÉÒÔʹÓÃSET PASSWORDÓï¾ä£º 
shell> mysql -u root mysql
mysql> SET PASSWORD FOR root=PASSWORD('new_password');
ÉèÖÿÚÁîµÄÁíÒ»ÖÖ·½·¨ÊÇʹÓÃmysqladminÃüÁ 
shell> mysqladmin -u root password new_password 
×¢Ò⣺Èç¹ûÄãʹÓõÚÒ»ÖÖ·½·¨ÔÚuser±íÀïÖ±½Ó¸üпÚÁÄã±ØÐë¸æËß·þÎñÆ÷ÔٴζÁÈëÊÚȨ±í(ÓÃFLUSH PRIVILEGES)£¬ÒòΪ·ñÔò¸Ä±ä½«²»±»×¢Òâµ½¡£ 
Ò»µ©root¿ÚÁî±»ÉèÖ㬴˺óµ±Äã×÷ΪrootÓë·þÎñÆ÷Á¬½Óʱ£¬Äã±ØÐ빩ӦÄǸö¿ÚÁî¡£ 
Äã¿ÉÄÜÏ£ÍûÈÃroot¿ÚÁîΪ¿Õ°×ÒԱ㵱ÄãÊ©Ðи½¼ÓµÄ°²×°Ê±£¬Äã²»ÐèÒªÖ¸¶¨Ëü»ò²âÊÔ£¬µ«ÊDZ£Ö¤ÔÚÈκÎÕæÊµµÄÉú²ú¹¤×÷ÖÐʹÓÃÄãµÄ°²×°Ö®Ç°£¬ÉèÖÃËü¡£
......

[ORACLE]ORACLE ʵÏÖmysqlÖеÄlimit ¹¦ÄÜ

ÏîÄ¿´ÓmysqlÇ¨ÒÆµ½ORACLEÖÐÓöµ½ÒÆÖ²ÎÊÌ⣬mysqlÖÐÖ§³Ölimit ¶øORACLE say no .
½â¾ö·½·¨ ÀûÓÃORACLEµÄαÁÐ rownumÀ´¿ØÖÆ¡£¡£
Mysql : select * from table limit 10
equl
ORACLE£º select * from table where rownum <= 10
ORACLE αÁнéÉÜ£º
ËæÊý¾Ý×ÖµäÒ»Æð×Ô¶¯´´½¨µÄÒ»¸ö±í,ÊôÓÚsysģʽ,ÈκÎÓû§¶¼¿ÉÒÔ·ÃÎÊ, Ö»ÓÐÒ»ÁÐdummy(varchar2(1)),·µ»ØÖµÒ²Ö»ÓÐÒ»ÐÐ,
Òò´Ë,ÔÚ½øÐÐselect ¼ÆËã³£Á¿±í´ïʽ»òÕßαÁÐʱ³£³£Óõ½.
oracleÖеij£Óõ½µÄαÁÐ:
ÐòÁÐ  
  currval:ÐòÁÐ當ǰֵ  
  nextval:ÐòÁеÄÐÂÖµ       
 
level:²ã´Î²éѯÖеIJãÊý    
  rowid:ÌØ¶¨µÄÐбí識·û      
  rownum:ÐÐÐò號
Ó÷¨:
ÐòÁÐ:  
  create   sequence   sequence1;    
  currval:  
 
select   sequence1.currval   from   dual;  
  nextval:  
 
select   sequence1.nextval   from   dual;    ......

[ORACLE]ORACLE ʵÏÖmysqlÖеÄlimit ¹¦ÄÜ

ÏîÄ¿´ÓmysqlÇ¨ÒÆµ½ORACLEÖÐÓöµ½ÒÆÖ²ÎÊÌ⣬mysqlÖÐÖ§³Ölimit ¶øORACLE say no .
½â¾ö·½·¨ ÀûÓÃORACLEµÄαÁÐ rownumÀ´¿ØÖÆ¡£¡£
Mysql : select * from table limit 10
equl
ORACLE£º select * from table where rownum <= 10
ORACLE αÁнéÉÜ£º
ËæÊý¾Ý×ÖµäÒ»Æð×Ô¶¯´´½¨µÄÒ»¸ö±í,ÊôÓÚsysģʽ,ÈκÎÓû§¶¼¿ÉÒÔ·ÃÎÊ, Ö»ÓÐÒ»ÁÐdummy(varchar2(1)),·µ»ØÖµÒ²Ö»ÓÐÒ»ÐÐ,
Òò´Ë,ÔÚ½øÐÐselect ¼ÆËã³£Á¿±í´ïʽ»òÕßαÁÐʱ³£³£Óõ½.
oracleÖеij£Óõ½µÄαÁÐ:
ÐòÁÐ  
  currval:ÐòÁÐ當ǰֵ  
  nextval:ÐòÁеÄÐÂÖµ       
 
level:²ã´Î²éѯÖеIJãÊý    
  rowid:ÌØ¶¨µÄÐбí識·û      
  rownum:ÐÐÐò號
Ó÷¨:
ÐòÁÐ:  
  create   sequence   sequence1;    
  currval:  
 
select   sequence1.currval   from   dual;  
  nextval:  
 
select   sequence1.nextval   from   dual;    ......

MySQL³£ÓÃÃüÁî

1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖØ¸´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âǰ£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°ÈÕÆÚ
select version(),current_date;
2¡¢ÐÞ¸ÄmysqlÖÐrootµÄÃÜÂ룺
shell>mysql -u root -p
mysql> update user set password=password(”xueok654123″) where user=’root’;
mysql> flush privileges //Ë¢ÐÂÊý¾Ý¿â
mysql>use dbname£» ´ò¿ªÊý¾Ý¿â£º
mysql>show databases; ÏÔʾËùÓÐÊý¾Ý¿â
mysql>show tables; ÏÔʾÊý¾Ý¿âmysqlÖÐËùÓÐµÄ±í£ºÏÈuse mysql£»È»ºó
mysql>describe user; ÏÔʾ±ímysqlÊý¾Ý¿âÖÐuser±íµÄÁÐÐÅÏ¢£©£»
3¡¢grant
´´½¨Ò»¸ö¿ÉÒÔ´ÓÈκεط½Á¬½Ó·þÎñÆ÷µÄÒ»¸öÍêÈ«µÄ³¬¼¶Óû§£¬µ«ÊDZØÐëʹÓÃÒ»¸ö¿ÚÁîsomething×öÕâ¸ö
mysql> grant all privileges on *.* to user@localhost identified by ’something’ with
Ôö¼ÓÐÂÓû§
¸ñʽ£ºgrant select on Êý¾Ý¿â. ......

MYSQL ±¸Íü¼

MySQL client programs:
mysql
The command-line tool for interactively entering SQL statements or executing them from a file in batch mode. See Section 4.5.1, “mysql — The MySQL Command-Line Tool”.
mysqladmin
A client that performs administrative operations, such as creating or dropping databases, reloading the grant tables, flushing tables to disk, and reopening log files. mysqladmin can also be used to retrieve version, process, and status information from the server. See Section 4.5.2, “mysqladmin — Client for Administering a MySQL Server”.
mysqlcheck
A table-maintenance client that checks, repairs, analyzes, and optimizes tables. See Section 4.5.3, “mysqlcheck — A Table Maintenance and Repair Program”.
mysqldump
A client that dumps a MySQL database into a file as SQL, text, or XML. See Section 4.5.4, “mysqldump — A Database Backup Program”.
mysqlimport
A client that imports ......

debianÏÂmysql¶ÔÖÐÎĵÄÖ§³ÖÎÊÌâ

ÐÞ¸Ä /etc/mysql/my.cnf Îļþ£¬
ÔÚ £Ûclient£Ý ϼÓÈë default-character-set=utf8,
ÔÚ   [mysqld] ϼÓÈë default-character-set=utf8,
ÔòÔÚviÀï¿ÉÒÔÕýÈ·µÄÏÔʾÖÐÎÄÁË£¨Ç°ÌáÊÇviҲʹÓÃutf8£©¡£
²»¹ýÔÚ²éѯµÄʱºò£¬½á¹ûÀïµÄÖÐÎÄÈ´»áÏÔʾ³É "?"£¬Õâ¸öÎÊÌâ±È½Ï¼òµ¥µÄ·½·¨Óм¸ÖÖ£¬·Ö±ðÊÇ£º
1.ÔÚ´´½¨Êý¾Ý¿âʱ¼´Ö¸¶¨Êý¾Ý¿â×Ö·û¼¯(»¹¿ÉÒÔ˳´øÖ¸¶¨Ð£¶Ô¹æÔò)£º
mysql> CREATE DATABASE
db_name
  mysql> DEFAULT CHARACTER SET utf8 £Û
COLLATE utf8
£Ý;
2.ÔÚ´´½¨±íµÄʱºòÖ¸¶¨±í×Ö·û¼¯£º
  mysql> CREATE TABLE
tbl_name
(
column_list
)
  mysql> DEFAULT CHARACTER SET
charset_name
COLLATE
collation_name
3.Ö¸¶¨ÁÐ×Ö·û¼¯(ÿһ¸ö“×Ö·û
”ÁУ¨¼´£¬CHAR
¡¢VARCHAR
»òTEXT
ÀàÐ͵ÄÁУ©ÓÐÒ»¸öÁÐ×Ö·û¼¯ºÍÒ»¸öÁÐ
У¶Ô¹æÔò£¬Ëü²»ÄÜΪ
  ¿Õ¡£Áж¨ÒåÓï·¨ÓÐÒ»¸ö¿ÉÑ¡×Ó¾äÀ´Ö¸¶¨ÁÐ×Ö·û¼¯ºÍУ¶Ô¹æÔò)£º
  mysql>  CREATE TABLE Table1
  mysql>  (
  mysql>  column1 VARCHAR(5)
CHARACTER SET latin1 COLLATE latin1_german1_ci
&nbs ......

MySql´´½¨º¯Êý

Ê×ÏÈÐèÒª²é¿´Ò»Ï´´½¨º¯ÊýµÄ¹¦ÄÜÊÇ·ñ¿ªÆô£º
X:\proper\mysql\bin>mysql -h localhost -u root -p
Enter password: **********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 5.0.22-community-nt-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show variables like '%func%';
+-----------------------------------------+-------+
| Variable_name                            | Value |
+-----------------------------------------+-------+
| log_bin_trust_function_creators | ON    |
+-----------------------------------------+-------+
1 row in set (0.02 sec)
Èç¹ûValue´¦ÖµÎªOFF£¬ÔòÐ轫Æä¿ªÆô¡£
mysql> set global log_bin_trust_function_creators=1;
´´½¨º¯Êýʱ£¬ÏÈÑ¡ÔñÊý¾Ý¿â£¬
mysql> use xxx;
Database changed
delimiter $$ÊÇÉèÖà $$ΪÃüÁîÖÕÖ¹·ûºÅ£¬´úÌæ·ÖºÅ£¬ÒòΪ·ÖºÅÔÚbegin...endÖл ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [3039] [3040] [3041] [3042] 3043 [3044] [3045] [3046] [3047] [3048]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ