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

mysqlÖÐÈ¥³ýÖØ¸´Ï±£ÁôÒ»Ìì

query result(14 records)
id
uid
gid
1
11
502
2
107
502
3
100
503
4
110
501
5
112
501
6
104
502
7
100
502
8
100
501
9
102
501
10
104
502
11
100
502
12
100
501
13
102
501
14
110
501
µÚÆßÌõÓëµÚʮһÌõÖØ¸´µÈ
·½·¨Ò»
mysql> create temporary table tmp_wrap select * from users_groups group by uid having count(1) >= 1;
Query OK, 7 rows affected (0.11 sec)
Records: 7  Duplicates: 0  Warnings: 0
mysql> truncate table users_groups;
Query OK, 14 rows affected (0.03 sec)
mysql> insert into users_groups select * from tmp_wrap;
Query OK, 7 rows affected (0.03 sec)
Records: 7  Duplicates: 0  Warnings: 0
mysql> select * from users_groups;
query result(7 records)
id
uid
gid
1
11
502
2
107
502
3
100
503
4
110
501
5
112
501
6
104
502
9
102
501
mysql> drop table tmp_wrap;
Query OK, 0 rows affected (0.05 sec)
2¡¢»¹ÓÐÒ»¸öºÜ¾«¼òµÄ°ì·¨¡£
²éÕÒÖØ¸´µÄ£¬²¢ÇÒ³ýµô×îСµÄÄǸö¡£
delete users_groups as a from users_groups as a,
(
select *,min(id) from users_groups group by uid having count(1) > 1
) as b
 where a.uid = b.uid and a.id > b.id;
(7 row(s)affected)
(0 ms taken)
 
query result(7 records)
id
uid
gid
1
11
502
2
107
502
3
100
503
4
110
501
5
112
501
6
104
502
9
102
501


Ïà¹ØÎĵµ£º

LinuxϵͳÏÂÐÞ¸ÄMySQLµÄrootÃÜÂë

µÚÒ»ÖÖ·½·¨£º
rootÓû§µÇ¼ϵͳ
usr/local/mysql/bin/mysqladmin -u root -p password ÐÂÃÜÂë
enter password ¾ÉÃÜÂë
µÚ¶þÖÖ·½·¨£º
rootÓû§µÇ¼mysqlÊý¾Ý¿â
mysql> update mysql.user set password=password("ÐÂÃÜÂë")where User="root";
mysql> flush privileges;
mysql> quit ;
mysqlÍü¼ÇrootÃÜÂëÈçºÎ ......

¹ØÓÚMySQL ORDER BY

ÓÉÓÚϵͳÐèÒª£¬Ð´ÁËÒ»¸öORDER BY µÄSQL²éѯÓï¾ä½øÐÐ×Ö¶ÎÅÅÐò£¬²éѯ½á¹ûûÓнøÐÐÅÅÐò£¬SQLÓï·¨ÕýÈ·£»
ÓÚÊÇ£¬½øÈëMySQL¿ØÖÆÌ¨£¬Ö´ÐÐSQLÓï¾ä£¬Ã»Óб¨´í£¬µ«ÊǾÍÊÇûÓÐÅÅÐò£»
¾­¹ý²éÕÒ·¢ÏÖ£¬ÔÚд ORDER BY ' time' DESC  Óï¾äÖУ¬Ê¹ÓÃÁË“ ' ”·ûºÅ£¬µ¼ÖÂMySQLÎÞ·¨Õý³£½âÎö£¬È¥µôÅÅÐòÕý³££»
»òÕß¿ÉÒÔÓà &ldqu ......

linuxÏÂmysql±àÒë°²×°·½·¨±¸Íü

# tar -zxvf mysql-5.0.45.tar.gz -C /usr/src/
# cd /usr/src/mysql-5.0.45
# ./configure --prefix=/usr/local/mysql --with-charset=gbk
--localstatedir=/usr/local/mysql/data
# make
# make install
# groupadd mysql
# useradd mysql -g mysql
# cd /usr/local/mysql/bin
# ./mysql_install_db --user=mys ......

WindowsÏÂMySQL֨װÒýÆðÎÊÌâµÄ½â¾ö

½â¾öÁËPlugin 'InnoDB' init function returned errorÎÊÌâºÍerror1405ÄǸö°²È«ÉèÖÃÃÜÂëµÇ½ÎÊÌ⣬ÎÒ¸öÈ˾õµÃ¹Ø¼üµãÔÚÓÚɾ³ýC:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\Ŀ¼ÏµÄÊý¾ÝÎļþ£¬µ±È»£¬ÎÒ²»¿ÉÄÜÔÚÖØÏÖÎÊÌâÇóÖ¤ÁË£¬²»¹ý¿´´ËÌùµÄÈË¿ÉÒÔ³¢ÊÔÒ»ÏÂÖ»×ö´Ë²½ÊÇ·ñÄܽâ¾öÎÊÌ⣬µ±È»»¹ÓÐÉ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ