??xml version="1.0" encoding="utf-8" standalone="yes"?>6699嫩草久久久精品影院,日韩欧美自拍,亚洲自拍偷拍一区http://www.aygfsteel.com/JafeLee/category/25735.htmlzh-cnFri, 21 Sep 2007 17:52:35 GMTFri, 21 Sep 2007 17:52:35 GMT60MySQL命o(h) (9) -- 备䆾和恢?/title><link>http://www.aygfsteel.com/JafeLee/archive/2007/09/21/146817.html</link><dc:creator>Jafe</dc:creator><author>Jafe</author><pubDate>Fri, 21 Sep 2007 13:47:00 GMT</pubDate><guid>http://www.aygfsteel.com/JafeLee/archive/2007/09/21/146817.html</guid><wfw:comment>http://www.aygfsteel.com/JafeLee/comments/146817.html</wfw:comment><comments>http://www.aygfsteel.com/JafeLee/archive/2007/09/21/146817.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/JafeLee/comments/commentRss/146817.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/JafeLee/services/trackbacks/146817.html</trackback:ping><description><![CDATA[1、备份整个数据库Q估计也是最土的Ҏ(gu)了)<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">mysqldump </span><span style="color: rgb(0, 128, 128);">--</span><span style="color: rgb(0, 128, 128);">user=user --host=host --port=port </span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 128, 128);">--</span><span style="color: rgb(0, 128, 128);">password=password dbname > filename.sql</span></div><ul><li>如果没有指定 host和port参数Q则客户端会(x)q向localhost的mysql server?/li><li>如果要备份多个数据库Q则可添加参?--database, 例如 --databases db1 db2</li><li>要备份数据库需要必要权?/li></ul>2、备份整个数据库相应的恢复方法:(x)<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">mysql </span><span style="color: rgb(0, 128, 128);">--</span><span style="color: rgb(0, 128, 128);">user=user --host=host --port=port --password=password dbname < filename.sql</span></div><br />Q未完待l,在研究中~)<br /><img src ="http://www.aygfsteel.com/JafeLee/aggbug/146817.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/JafeLee/" target="_blank">Jafe</a> 2007-09-21 21:47 <a href="http://www.aygfsteel.com/JafeLee/archive/2007/09/21/146817.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MySQL命o(h) (8) -- 客服端命令行http://www.aygfsteel.com/JafeLee/archive/2007/09/21/146589.htmlJafeJafeFri, 21 Sep 2007 13:46:00 GMThttp://www.aygfsteel.com/JafeLee/archive/2007/09/21/146589.htmlhttp://www.aygfsteel.com/JafeLee/comments/146589.htmlhttp://www.aygfsteel.com/JafeLee/archive/2007/09/21/146589.html#Feedback1http://www.aygfsteel.com/JafeLee/comments/commentRss/146589.htmlhttp://www.aygfsteel.com/JafeLee/services/trackbacks/146589.html
mysql [-h host] [-u user_name] [-p] [db_name]
注意Q?br />
  •  db_name 表示默认数据库,相当与连接成功后的use db_name?/li>
  • -p 表示密码选项Q当有该选项是,mysql?x)弹出密码输入对话框Q否则mysql以匿名形式向服务器发送登录请?/li>
  • 也可以在-p后直接加上密码,mysql直接向服务器发送登录请求,注意密码?p之间不能有空?/li>
2、批量处理命令:(x)
echo 'SELECT 1 + 1' | mysql -u some_user -p
mysql命o(h)行也支持重定向:(x)
mysql -user -< input_file > output_file

3、如果要清除当前行的命o(h)在命令后d \cQ例如:(x)
DROP DATABASE foo;\c
(未完待箋Q因不是很重要,暂不研究Q?br />

Jafe 2007-09-21 21:46 发表评论
]]>
MySQL命o(h) (7) -- 用户理http://www.aygfsteel.com/JafeLee/archive/2007/09/19/146292.htmlJafeJafeWed, 19 Sep 2007 11:19:00 GMThttp://www.aygfsteel.com/JafeLee/archive/2007/09/19/146292.htmlhttp://www.aygfsteel.com/JafeLee/comments/146292.htmlhttp://www.aygfsteel.com/JafeLee/archive/2007/09/19/146292.html#Feedback0http://www.aygfsteel.com/JafeLee/comments/commentRss/146292.htmlhttp://www.aygfsteel.com/JafeLee/services/trackbacks/146292.htmlCREATE USER user@host IDENTIFIED BY 'password';例如Q?br />
CREATE USER test@localhost IDENTIFIED BY 'localhost';
以及(qing)
CREATE USER test@192.76.23.10 IDENTIFIED BY 'remote';
上面两个例子创徏的用户名名字虽然相同Q但是两个的差别实相当大的Q例如,W一个test只能从本机登录,W二个test只能从ip?192.76.23.10的机器登录。MySQL服务器通过两者的password来区别他们?br />
2、删除一个用P(x)
DROP USER user@host;
如果没指明hostQ则默认?drop user user@"%"Q你必须在此前创建相应的用户Q否则会(x)引发错误?br />
3、重命名一个用P(x)
RENAME USER old_user@host TO new_user@host;
实际上该命o(h)既可以修改usernameQ也可以修改host~

4、用通配W?% :
CREATE USER 'test'@'192.76.23.%';

CREATE USER 'test'@'%';

5、获取有关用户和数据库关pȝ信息Q?br />
SELECT Db FROM db 
WHERE User = 'user' AND Host = 'host';


SELECT Table_name FROM tables_priv
WHERE User = 'user'
AND Host = 'host' AND Db = 'db';
注意Q表 db在数据库mysql中,该数据库q包括很多其他信息?br />
6、设|密码:(x)
讄自己的密码:(x)
SET PASSWORD = PASSWORD('password');

讄别h的密码(必须有管理权限)Q?br />
SET PASSWORD FOR user@host = PASSWORD('password');

7、赋予用户一定权限:(x)
GRANT privileges ON db.table
TO user@host
IDENTIFIED 
BY 'password';
收回用户权限Q?br />
REVOKE privileges ON db.table
FROM user@host
IDENTIFIED 
BY 'password';



Jafe 2007-09-19 19:19 发表评论
]]>
MySQL命o(h) (6) -- 修改数据http://www.aygfsteel.com/JafeLee/archive/2007/09/18/146168.htmlJafeJafeTue, 18 Sep 2007 10:31:00 GMThttp://www.aygfsteel.com/JafeLee/archive/2007/09/18/146168.htmlhttp://www.aygfsteel.com/JafeLee/comments/146168.htmlhttp://www.aygfsteel.com/JafeLee/archive/2007/09/18/146168.html#Feedback0http://www.aygfsteel.com/JafeLee/comments/commentRss/146168.htmlhttp://www.aygfsteel.com/JafeLee/services/trackbacks/146168.htmlUPDATE book SET cond = 'mint';一般不要这么用Q因?x)将一个column的所有行的cond设ؓ(f) 'mint'?br />
UPDATE book SET author = "Theodor Geisel" WHERE author = "Dr. Seuss";

2、在update中用公式:(x)
UPDATE loan
SET date_lent = DATE_ADD(date_lent, INTERVAL 1 YEAR)
WHERE date_lent = '2005-01-01';

3、删除行Q?br />
DELETE FROM book WHERE cond = 'poor';
如果省略 where 语句Q则?x)删除掉所有列

4、从多个表中删除Q?br />
DELETE book, loan    # tables to delete from
FROM book, loan    # tables to use in WHERE clause
WHERE book.book_id = loan.book_id
AND book.cond = 'poor';



Jafe 2007-09-18 18:31 发表评论
]]>
MySQL命o(h) (5) -- 获取数据http://www.aygfsteel.com/JafeLee/archive/2007/09/14/145044.htmlJafeJafeFri, 14 Sep 2007 02:45:00 GMThttp://www.aygfsteel.com/JafeLee/archive/2007/09/14/145044.htmlhttp://www.aygfsteel.com/JafeLee/comments/145044.htmlhttp://www.aygfsteel.com/JafeLee/archive/2007/09/14/145044.html#Feedback0http://www.aygfsteel.com/JafeLee/comments/commentRss/145044.htmlhttp://www.aygfsteel.com/JafeLee/services/trackbacks/145044.htmlQ?Q?br />
SELECT author FROM book LIMIT 2;
该命令将q回前两行记?br />Q?Q?br />
SELECT author FROM book LIMIT 12;
该命令返回两条记录,但是该记录是从第二条记录开始算P注意,行数计数的vҎ(gu)?而不?开始的Q这跟Java中的数组很象)

2、排序返回的l果Q(order by)
SELECT name, birth FROM pet ORDER BY birth;

q回的序列以升序Q默认)形式排列Q如果想降序排列Q则需要这P(x)
SELECT name, birth FROM pet ORDER BY birth DESC;

你也可以昑ּ指明按升序方式排列:(x)
SELECT name, birth FROM pet ORDER BY birth ASC;

DESCQASCQ也可以应用与多个column中:(x)
SELECT name, species, birth FROM pet ORDER BY species, birth DESC;
l果Q?br />
+----------+---------+------------+
| name     | species | birth      |
+----------+---------+------------+
| Chirpy   | bird    | 1998-09-11 |
| Whistler | bird    | 1997-12-09 |
| Claws    | cat     | 1994-03-17 |
| Fluffy   | cat     | 1993-02-04 |//------------------
| Fang     | dog     | 1990-08-27 |//  降序排列
| Bowser   | dog     | 1989-08-31 |// 
| Buffy    | dog     | 1989-05-13 |//
| Puffball | hamster | 1999-03-30 |//-------------------
| Slim     | snake   | 1996-04-29 |
+----------+---------+------------+

3、去掉返回结果中相同的记录(只返回一个)Q?br />
SELECT DISTINCT amount FROM loan;

4、模p查询:(x)
SELECT name FROM author WHERE name LIKE 'M%';
MySQL有两个通配W?% ?_ 。其?% 匚w 0或多个Q意的字符Q?_ 匚w一?L字符

5、获得某一行的最倹{最大倹{^均| dQ?br />
SELECT MIN(wt), AVG(wt), MAX(wt), SUM(wt) FROM person;

6、时间运:(x)
 SELECT NOW(), CURTIME(), CURDATE();
q行l果Q?br />
+-----------------------+-----------+------------+
| NOW()                      | CURTIME() | CURDATE()  |
+-----------------------+-----------+------------+
| 2007-09-14 10:42:20 | 10:42:20| 2007-09-14|
+-----------------------+-----------+------------+

7、把查询l果导出到文Ӟ(x)
SELECT * FROM author
  
INTO OUTFILE '/tmp/author'
    FIELDS TERMINATED 
BY ','
    ENCLOSED 
BY '"'
    LINES TERMINATED 
BY '\n';

当用 into dumpfile 代替 into outfileӞselect语句q回的结果必M能多?条。into dumpfile写入文g的格式既没有column分隔W,也没有行分隔W,q在BLOB写入文g时很有用?br />

Jafe 2007-09-14 10:45 发表评论
]]>
MySQL命o(h) (4) -- 存储数据http://www.aygfsteel.com/JafeLee/archive/2007/09/12/144458.htmlJafeJafeWed, 12 Sep 2007 15:10:00 GMThttp://www.aygfsteel.com/JafeLee/archive/2007/09/12/144458.htmlhttp://www.aygfsteel.com/JafeLee/comments/144458.htmlhttp://www.aygfsteel.com/JafeLee/archive/2007/09/12/144458.html#Feedback0http://www.aygfsteel.com/JafeLee/comments/commentRss/144458.htmlhttp://www.aygfsteel.com/JafeLee/services/trackbacks/144458.html
INSERTINTO table_name (list of columns) VALUES (list, ofvalues);

其中INTOg可以省略掉~

2、一ơ插入多条记录:(x)看下面的例子

INSERT book (author, title, cond) VALUES
    (
'Maurice Sendak','In the Night Kitchen','mint'),
    (
'Caroll Spinney','How to Be a Grouch','poor'),
    (
'Dr. Seuss''Green Eggs and Ham''good');

3、auto_increment属性:(x)
CREATE TEMPORARY TABLE demo (
  id 
INT NOT NULL AUTO_INCREMENT,
     
PRIMARY KEY (id)
);
INSERT demo () VALUES ();
SELECT id FROM demo; # id contains 1
INSERT demo (id) VALUES (NULL);
SELECT id FROM demo; # id contains 1 and 2
INSERT demo (id) VALUES (4);
SELECT id FROM demo; # id contains 12 and 4
INSERT demo (id) VALUES (NULL);
SELECT id FROM demo; # id contains 124 and 5

注意Q一个表臛_只能一个column是auto_increment的,而且该column必须是primary key的一个组成部?br />

4、插入当前日期和旉Q?br />
INSERT some_table (some_column) VALUES (NOW());
q行
SELECT NOW();
可得到当前时?

5、从执行文g执行命o(h)Q有两种Ҏ(gu)Q:(x)
Q?Q?br />
mysql -username -db_name < file_name.sql
敲入该命令之后,?x)有一个密码输入的提示W,输入密码之后Q会(x)执行file_name.sql中的命o(h)q打印这些命令返回的l果?br />Q?Q首先从命o(h)行连接连接数据库Q在mysql的提C符下敲入:(x)
\. file_name.sql
其中 \.表示从文件中执行命o(h)Q?文g名既可以包含l对路径也可以包含相对\?br />
6、从另一个表复制数据Q?br />
INSERT table_one (list, of, columns) SELECT ;
注意Qselect q回的column的类型和column的个数必Minsert的column和个数相兼容?br />
7、从文g导入数据Q?div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">LOAD DATA INFILE 'some_file' INTO TABLE table_name (list, of, columns, );
需注意的几点:(x)
  • LOAD DATA INFILE 有很多参敎ͼ具体可参照MySQL reference
  • 数据文g必须和mysql server在同一台机器上Q如果是q程机器Q则必须在INFILE之前d参数l(f)ocal
  • 文g名最好加上绝对\径,如果没有指明完整路径Q则mysql server?x)在它的数据目录下寻找该文gQ如果有local参数Q则?x)在你启动客服端的目录下?/li>
  • 在windows下,路径的标识符不能用反斜杠 \ ,只能使用正斜?/ 或者用{义字W?\\
  • 使用技巧:(x)可以用show errors; 或show warnings;命o(h)来查看返回的具体的错误信息。在数据导入到table之前Q可以先建立一个和要导入的表的l构一样temporary table(使用create table  ...like 命o(h)Q把数据导入到该临时表中看看l果是否正确
8、存储精的点敎ͼ(x)使用DECIMALcdQ该cd在MySQL中是一字符串的形式存储的?br />

Jafe 2007-09-12 23:10 发表评论
]]>
MySQL命o(h) (3) -- Column 操作http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144376.htmlJafeJafeTue, 11 Sep 2007 14:52:00 GMThttp://www.aygfsteel.com/JafeLee/archive/2007/09/11/144376.htmlhttp://www.aygfsteel.com/JafeLee/comments/144376.htmlhttp://www.aygfsteel.com/JafeLee/archive/2007/09/11/144376.html#Feedback0http://www.aygfsteel.com/JafeLee/comments/commentRss/144376.htmlhttp://www.aygfsteel.com/JafeLee/services/trackbacks/144376.html
SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [LIKE 'pattern']

2、添加一个columnQ?br />
ALTER TABLE table_name ADD COLUMN [column_definition];
例如Q?div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">ALTER TABLE book ADD COLUMN ISBN VARCHAR(10NOT NULL;
注意如果该column是NOT NULL的,则原来已l存在的rows对应的新的column会(x)被置为nullQ但是添加新的rowӞ该column׃能ؓ(f)IZ?br />
3、修改一个columnQ?(alter可以修改多少内容?)
ALTER TABLE table_name CHANGE COLUMN column_name [column_definition];
例如Q?br />
ALTER TABLE book CHANGE COLUMN ISBN isbn VARCHAR(10NOT NULL;

4、删除一个columnQ?br />
ALTER TABLE table_name DROP COLUMN column_name;



Jafe 2007-09-11 22:52 发表评论
]]>
MySQL命o(h) (2) -- 理?/title><link>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144266.html</link><dc:creator>Jafe</dc:creator><author>Jafe</author><pubDate>Tue, 11 Sep 2007 07:15:00 GMT</pubDate><guid>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144266.html</guid><wfw:comment>http://www.aygfsteel.com/JafeLee/comments/144266.html</wfw:comment><comments>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144266.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/JafeLee/comments/commentRss/144266.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/JafeLee/services/trackbacks/144266.html</trackback:ping><description><![CDATA[1、列出某一个数据库中的所有表的名字:(x)<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">SHOW TABLES;<br />SHOW TABLES </span><span style="color: rgb(128, 128, 128);">IN</span><span style="color: rgb(0, 0, 0);"> database_name;<br />SHOW TABLES </span><span style="color: rgb(128, 128, 128);">LIKE</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(255, 0, 0);">word%</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br />SHOW TABLES </span><span style="color: rgb(128, 128, 128);">IN</span><span style="color: rgb(0, 0, 0);"> database_name </span><span style="color: rgb(128, 128, 128);">LIKE</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(255, 0, 0);">word%</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span></div>注意要用上面第一和第三个命o(h)必须先指定默认数据库(使用USE 命o(h)Q?br /><br />2、创Z个简单的表:(x)<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">create</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">table</span><span style="color: rgb(0, 0, 0);"> account<br />(account_number </span><span style="color: rgb(0, 0, 0); font-weight: bold;">char</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(128, 0, 0); font-weight: bold;">10</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(128, 128, 128);">not</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">,<br />branch_name </span><span style="color: rgb(0, 0, 0); font-weight: bold;">char</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(128, 0, 0); font-weight: bold;">20</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(128, 128, 128);">not</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">,<br />balance numeric(</span><span style="color: rgb(128, 0, 0); font-weight: bold;">10</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0); font-weight: bold;">3</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(128, 128, 128);">not</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">,<br /></span><span style="color: rgb(0, 0, 255);">primary</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">key</span><span style="color: rgb(0, 0, 0);"> (account_number));<br /></span></div>实际中创Z个表q比q个复杂Q具体可以查看MySQL相关文档?br /><br />3、重命名一个表Q和重命名一个数据库相比Q重命名一个表相当单、直?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">RENAME </span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);"> old_name </span><span style="color: rgb(0, 0, 255);">TO</span><span style="color: rgb(0, 0, 0);"> new_name;</span></div><br />4、删除一个表Q?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">DROP</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);"> table_name;</span></div><br />5、复制一个表Q?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">CREATE</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);"> new_table </span><span style="color: rgb(128, 128, 128);">LIKE</span><span style="color: rgb(0, 0, 0);"> old_table;<br /></span><span style="color: rgb(0, 0, 255);">INSERT</span><span style="color: rgb(0, 0, 0);"> new_table </span><span style="color: rgb(0, 0, 255);">SELECT</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 128, 128);">*</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">FROM</span><span style="color: rgb(0, 0, 0);"> old_table;<br /></span></div><br />也可以从一个数据库把表copy到另一个数据库Q?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">CREATE</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);"> db1.</span><span style="color: rgb(0, 0, 255);">table</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 128, 128);">LIKE</span><span style="color: rgb(0, 0, 0);"> db2.</span><span style="color: rgb(0, 0, 255);">table</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 0, 255);">INSERT</span><span style="color: rgb(0, 0, 0);"> db1.</span><span style="color: rgb(0, 0, 255);">table</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">SELECT</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 128, 128);">*</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">FROM</span><span style="color: rgb(0, 0, 0);"> db2.</span><span style="color: rgb(0, 0, 255);">table</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span></div>注意Q在q里LIKEq不是通配W的标志<br /><img src ="http://www.aygfsteel.com/JafeLee/aggbug/144266.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/JafeLee/" target="_blank">Jafe</a> 2007-09-11 15:15 <a href="http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144266.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MySQL命o(h) (1) -- 理数据?/title><link>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144252.html</link><dc:creator>Jafe</dc:creator><author>Jafe</author><pubDate>Tue, 11 Sep 2007 06:38:00 GMT</pubDate><guid>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144252.html</guid><wfw:comment>http://www.aygfsteel.com/JafeLee/comments/144252.html</wfw:comment><comments>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144252.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/JafeLee/comments/commentRss/144252.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/JafeLee/services/trackbacks/144252.html</trackback:ping><description><![CDATA[1、命令行q接MySQL数据库:(x)<br />    <strong class="userinput"><code>mysql -h <font color="#ff0000"><em class="replaceable"><code>host</code></em></font> -u <font color="#ff0000"><em class="replaceable"><code>user</code></em></font> -p</code></strong><br />    Enter password: <strong class="userinput"><code>********<br />其中 host是MySQLL的ipQ本机的话也可以用localhost)Quser是你的用户名<br /></code></strong><pre class="programlisting"></pre>2、列出服务器上所有数据库名称Q?span class="docEmphStrong"><b><font color="#0000ff"><a name="iddle1197"></a><a name="iddle1738"></a>SHOW DATABASES</font>; </b><br /><br />3、模p比配列出符合条件的数据库名Uͼ(x)</span><span id="wmqeeuq" class="docEmphStrong"><b><font color="#0000ff">SHOW DATABASES LIKE 'my%';<br /><br /></font></b><font color="#0000ff"><font color="#000000">4、设|默认数据库Q?/font></font></span><font color="#0000ff"><span id="wmqeeuq" class="docEmphStrong"><a name="iddle1203"></a>USE <font color="#ff0000"><i>databasename</i></font>; <font color="#000000"> 例如Q?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">SELECT</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 128, 128);">*</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">FROM</span><span style="color: rgb(0, 0, 0);"> bank.account;</span></div>{同于:(x)<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">USE</span><span style="color: rgb(0, 0, 0);"> bank;<br /></span><span style="color: rgb(0, 0, 255);">SELECT</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 128, 128);">*</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">FROM</span><span style="color: rgb(0, 0, 0);"> account;</span></div>也可以在q接时指定默认数据库Q?br /></font></span></font>       <strong class="userinput"><code>mysql -h <font color="#ff0000"><em class="replaceable"><code>host</code></em></font> -u <font color="#ff0000"><em class="replaceable"><code>user</code></em></font> -p <i>databasename<br /><br /></i></code></strong><font color="#0000ff"><span id="wmqeeuq" class="docEmphStrong"><font color="#000000">5、创建数据库QCREATE DATABASE <i><font color="#ff0000">databasename</font></i>;<br />    删除数据库:(x)DROP DATABASE <i><font color="#ff0000">databasename</font></i>;<br /><br />6、重命名一个数据库Q没有直接的命o(h)Q可以参照下面的例子Q似乎很碰到这U情늚Q?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">--</span><span style="color: rgb(0, 128, 128);"> Temporarily disable permissions</span><span style="color: rgb(0, 128, 128);"><br /></span><span style="color: rgb(0, 0, 255);">CREATE</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">DATABASE</span><span style="color: rgb(0, 0, 0);"> library;<br />RENAME </span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);"> books.book </span><span style="color: rgb(0, 0, 255);">TO</span><span style="color: rgb(0, 0, 0);"> library.book;<br />RENAME </span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);"> books.borrower </span><span style="color: rgb(0, 0, 255);">TO</span><span style="color: rgb(0, 0, 0);"> library.borrower;<br />RENAME </span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);"> books.loan </span><span style="color: rgb(0, 0, 255);">TO</span><span style="color: rgb(0, 0, 0);"> library.loan;<br /></span><span style="color: rgb(0, 128, 128);">--</span><span style="color: rgb(0, 128, 128);"> Migrate permissions</span><span style="color: rgb(0, 128, 128);"><br />--</span><span style="color: rgb(0, 128, 128);"> Re-enable permissions</span><span style="color: rgb(0, 128, 128);"><br /></span><span style="color: rgb(0, 0, 0);"><br /></span></div><br /></font></span></font><span id="wmqeeuq" class="docEmphStrong"></span><img src ="http://www.aygfsteel.com/JafeLee/aggbug/144252.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/JafeLee/" target="_blank">Jafe</a> 2007-09-11 14:38 <a href="http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144252.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MySQL Table 的一些术?/title><link>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144178.html</link><dc:creator>Jafe</dc:creator><author>Jafe</author><pubDate>Tue, 11 Sep 2007 02:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144178.html</guid><wfw:comment>http://www.aygfsteel.com/JafeLee/comments/144178.html</wfw:comment><comments>http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144178.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/JafeLee/comments/commentRss/144178.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/JafeLee/services/trackbacks/144178.html</trackback:ping><description><![CDATA[ <img src="http://www.aygfsteel.com/images/blogjava_net/jafelee/mysqltable.jpg" alt="mysqltable.jpg" align="middle" border="0" height="384" width="702" /> <br /> <img src ="http://www.aygfsteel.com/JafeLee/aggbug/144178.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/JafeLee/" target="_blank">Jafe</a> 2007-09-11 10:36 <a href="http://www.aygfsteel.com/JafeLee/archive/2007/09/11/144178.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">İ</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʶ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̽</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">տ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͬ</a>| <a href="http://" target="_blank">Ԫ</a>| <a href="http://" target="_blank">۲</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ܿ</a>| <a href="http://" target="_blank">ֿ</a>| <a href="http://" target="_blank">ī</a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">ָɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ൺ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">߰</a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">պ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">;</a>| <a href="http://" target="_blank">̩</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>