mysql µ¼Èëµ¼³ö
1.CMDÃüÁîÐÐÏÂÇл»µ½ mysql°²×°Ä¿Â¼ÏµÄbinĿ¼
ÀýÈç:cd D:\program\study\mysql\bin>
2. D:\program\study\mysql\bin> mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > sqlÎļþ´æ·Å·¾¶ºÍÃû³Æ
D:\program\study\mysql\bin>mysqldump -u root -p oa > D:\oa.sql
3.ÊäÈëÃÜÂë
4.ÉÔ΢µÈ´ýƬ¿Ì(Êý¾Ý¿â½Ï´óµÈ´ýʱ¼ä¿ÉÄܽϳ¤),Ö±µ½ D:\program\study\mysql\bin> ³öÏÖ¼´¿É
Ò».MYSQLµÄÃüÁîÐÐģʽµÄÉèÖãº
×ÀÃæ->ÎҵĵçÄÔ->ÊôÐÔ->»·¾³±äÁ¿->н¨->
PATH=“£»path\mysql\bin;”ÆäÖÐpathΪMYSQLµÄ°²×°Â·¾¶¡£
¶þ.¼òµ¥µÄ½éÉÜÒ»ÏÂÃüÁîÐнøÈëMYSQLµÄ·½·¨£º
1.C:\>mysql -h hostname -u username -p
°´ENTER¼ü£¬µÈ´ýÈ»ºóÊäÈëÃÜÂë¡£ÕâÀïhostnameΪ·þÎñÆ÷µÄÃû³Æ£¬Èçlocalhost£¬usernameΪMYSQLµÄÓû§Ãû£¬Èçroot¡£
½øÈëÃüÁîÐкó¿ÉÒÔÖ±½Ó²Ù×÷MYSQLÁË¡£
2.¼òµ¥½éÉÜÒ»ÏÂMYSQLÃüÁ
mysql->CREATE DATABASE dbname;//´´½¨Êý¾Ý¿â
mysql->CREATE TABLE tablename;//´´½¨±í
mysql->SHOW DATABASES;//ÏÔʾÊý¾Ý¿âÐÅÏ¢£¬ÓÐÄÇЩ¿ÉÓõÄÊý¾Ý¿â¡£
mysql->USE dbname;//Ñ¡ÔñÊý¾Ý¿â
mysql->SHOW TABLES;//ÏÔʾ±íÐÅÏ¢£¬ÓÐÄÇЩ¿ÉÓõıí
mysql->DESCRIBE tablename;//ÏÔʾ´´½¨µÄ±íµÄÐÅÏ¢
Èý.´ÓÊý¾Ý¿âµ¼³öÊý¾Ý¿âÎļþ£º
1.½«Êý¾Ý¿âmydbµ¼³öµ½e:\mysql\mydb.sqlÎļþÖУº
´ò¿ª¿ªÊ¼->ÔËÐÐ->ÊäÈëcmd ½øÈëÃüÁîÐÐģʽ
c:\>mysqldump -h localhost -u root -p mydb >e:\mysql\mydb.sql
È»ºóÊäÈëÃÜÂ룬µÈ´ýÒ»»áµ¼³ö¾Í³É¹¦ÁË£¬¿ÉÒÔµ½Ä¿±êÎļþÖмì²éÊÇ·ñ³É¹¦¡£
2.½«Êý¾Ý¿âmydbÖеÄmytableµ¼³öµ½e:\mysql\mytable.sqlÎļþÖУº
c:\>mysqldump -h localhost -u root -p mydb mytable>e:\mysql\mytable.sql
3.½«Êý¾Ý¿âmydbµÄ½á¹¹µ¼³öµ½e:\mysql\mydb_stru.sqlÎļþÖУº
c:\>mysqldump -h localhost -u root -p mydb --add-drop-table >e:\mysql\mydb_stru.sql
//-h localhost¿ÉÒÔÊ¡ÂÔ£¬ÆäÒ»°ãÔÚÐéÄâÖ÷»úÉÏÓÃ
ËÄ.´ÓÍⲿÎļþµ¼ÈëÊý¾Ýµ½Êý¾Ý¿âÖУº
´Óe:\mysql\mydb2.sqlÖн«ÎļþÖеÄSQLÓï¾äµ¼ÈëÊý¾Ý¿âÖУº
1.´ÓÃüÁîÐнøÈëmysql£¬È»ºóÓÃÃüÁîCREATE DATABASE mydb2;´´½¨Êý¾Ý¿âmydb2¡£
2.Í˳ömysql ¿ÉÒÔÊäÈëÃüÁîexit£»»òÕßquit£»
3.ÔÚCMDÖÐÊäÈëÏÂÁÐÃüÁ
c:\>mysql -h localhost -u root -p mydb2 < e:\mysql\mydb2.sql
È»ºóÊäÈëÃÜÂ룬¾ÍOKÁË¡£
Îå.ÏÂÃ
Ïà¹ØÎĵµ£º
sphinx°æ±¾Ê¹ÓõÄÊÇcoreseekÐ޸ĵÄÖ§ ³ÖÖÐÎļìË÷µÄ°æ±¾,ÖÐÎÄ´Ê¿âʹÓà coreseek¿ª·¢µÄlibmmseg
mysqlÊÜsphinxÖÐsphinxseÒýÇæÒªÇó°²×°ÁËmysql-5.0.37×öÉú²ú»·¾³µÄmysql-5.0.70µÄ´Ó¿â
±àÒësphinx,libmmsegÒÔ¼°mysql:
±àÒë°²×°libmmseg:
./configure --prefix=/usr/local/mmseg && make -j5 && make instal ......
˵Ã÷: ÔÚMYSQLÖУ¬Èç¹ûʹÓÃȱʡµÄ×Ö·û¼¯£¬ÔÚ½¨¿â¡¢½¨±íʱ£¬Ä¬ÈÏʹÓõÄÊÇlatin1×Ö·û¼¯£¬
ΪISO 8859-1Î÷Å·×Ö·û¼¯¡£²åÈëÖÐÎÄ×Ö·ûʱ£¬ÓëÖ®²»Æ¥Å䣬¾Í»á³öÏÖÂÒÂë¡£
¡¾½â¾ö·½°¸¡¿
1. ´ò¿ªÎļþ: C:\Program Files\MySQL\MySQL Server 5.0\my.ini;
2. ½«ÆäÖеÄdefault-character-set=latin1¸ÄΪdefault-character-set=gb2312,
......
MySQLµÄ×Ö·û¼¯Ö§³Ö(Character Set Support)ÓÐÁ½¸ö·½Ã棺
×Ö·û¼¯(Character set)ºÍÅÅÐò·½Ê½(Collation)¡£
¶ÔÓÚ×Ö·û¼¯µÄÖ§³Öϸ»¯µ½Ëĸö²ã´Î:
·þÎñÆ÷(server)£¬Êý¾Ý¿â(database)£¬Êý¾Ý±í(table)ºÍÁ¬½Ó(connection)¡£
1.MySQLĬÈÏ×Ö·û¼¯
  ......
ÏÖÔÚÔÚWEB Ó¦ÓÃÖÐʹÓ÷ÖÒ³¼¼ÊõÔ½À´Ô½ÆÕ±éÁË£¬ÆäÖÐÀûÓÃÊý¾Ý¿â²éѯ·ÖÒ³ÊÇÒ»ÖÖЧÂʱȽϸߵķ½·¨£¬
ÏÂÃæÁгöÁËOracle, DB2 ¼° MySQL ·ÖÒ³²éѯд·¨¡£
Ò»£ºOracle
select * from (select rownum,name from table where rownum <=endIndex )
where rownum > startIndex
¶þ£ºDB2
DB2·ÖÒ³²éѯ
SELECT * ......
ÎÒµÄmysql×°ÔÚ/usr/local/mysqlĿ¼ÏÂÆô
¶¯Åöµ½¹ýºÜ¶àÎÊÌâ¡£×î³£¼ûµÄÊÇ£º
ERROR 2002: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111)
½â¾ö°ì·¨£º
[root@test mysql]# /usr/local/mysql/bin/mysqladmin -u root /
> -S /var/lib/mysql/mysql.sock password 'your.passwd'
......