mysqlÃâ°²×°°æÅäÖÃÓëʹÓ÷½·¨
ÒÔmysql-noinstall-5.1.6(win32)ΪÀý
1>°ÑѹËõÎļþmysql-noinstall-5.1.6-alpha-win32.zip½âѹµ½Ò»¸öĿ¼Ï£¬ÔÚ»·¾³±äÁ¿ÖÐÉèÖÃMYSQL_HOME£¬°Ñ%MYSQL_HOME%\bin ¼Ó
Èëµ½ path¡£
2>´´½¨my.iniÅäÖÃÎļþ,ÄÚÈÝÈçÏ£º
[mysqld]
#ÉèÖÃbasedirÖ¸ÏòmysqlµÄ°²×°Â·¾¶
basedir=...\mysql
datadir=...\mysql\data
my.iniÎļþ·ÅÔÚϵͳÎļþÏÂÃæ
XPϵͳÔÚC:\windowsĿ¼ÏÂ,2000ϵͳÔÚC:\winntÏÂ
3>Æô¶¯ÓëÍ£Ö¹mysql
mysqld-nt.exe --install£¨°²×°windows·þÎñ£¬Ð¶ÔØʹÓÃmysqld-nt.exe --remove £©
Æô¶¯£ºnet start mysql
Í£Ö¹£ºnet stop mysql
4>Á¬½Ómysql
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
Àý1£ºÁ¬½Óµ½±¾»úÉϵÄmysql
mysql -uroot -p
Àý2£ºÁ¬½Óµ½Ô¶³ÌÖ÷»úÉϵÄmysql
mysql -h110.110.110.110 -uroot -pabcd123
5>Í˳ömysqlÃüÁî
exit£¨»Ø³µ£©
»òÕß
quit£¨»Ø³µ£©
6>ÐÞ¸ÄÃÜÂë
¸ñʽ£ºmysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
Àý:¸øroot¼Ó¸öÃÜÂëab12¡£Ê×ÏÈÔÚDOSϽøÈëĿ¼mysqlbin£¬È»ºó¼üÈëÒÔÏÂÃüÁî
mysqladmin -uroot password ab12
×¢£ºÒòΪ¿ªÊ¼Ê±rootûÓÐÃÜÂ룬ËùÒÔ-p¾ÉÃÜÂëÒ»Ïî¾Í¿ÉÒÔÊ¡ÂÔÁË¡£
2¡¢ Àý2£ºÔÙ½«rootµÄÃÜÂë¸ÄΪdjg345¡£
mysqladmin -uroot -pab12 password djg345
ÏÂÃæµÄÊÇmysql»·¾³ÖеÄÃüÁ ÒÔ·ÖºÅ×÷ΪÃüÁî½áÊø·û
7>Ôö¼ÓÐÂÓû§
¸ñʽ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë";
Àý1¡¢Ôö¼ÓÒ»¸öÓû§test1ÃÜÂëΪabc£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬ ²¢¶ÔËùÓÐÊý¾Ý¿âÓÐ
²éѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬Èëmysql£¬È»ºó¼üÈëÒÔÏÂÃüÁ
grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";
Àý2¡¢Ôö¼ÓÒ»¸öÓû§test2ÃÜÂëΪabc,ÈÃÆäÖ»¿ÉÒÔÔÚlocalhostÉϵǼ£¬ ²¢¿ÉÒÔ¶ÔÊý¾Ý¿â
mydb½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhostÖ¸±¾µØÖ÷»ú£¬ ¼´mysqlÊý¾Ý
¿âËùÔÚµÄÄÇ̨Ö÷»ú£©£¬ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀtest2µÄÃÜÂ룬ҲÎÞ·¨´ÓinternetÉÏÖ±
½Ó·ÃÎÊÊý¾Ý¿â£¬Ö»ÄÜͨ¹ýmysqlÖ÷»úÉϵÄwebÒ³À´·ÃÎÊÁË¡£
grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";
8>ÏÔʾÊý¾Ý¿âÁбí
show databases;
9>ÏÔʾ¿âÖеÄÊý¾Ý±í
use mysql;//Êý¾Ý¿âÃû³Æ
show tables;
10>ÏÔʾÊý¾Ý±íµÄ½á¹¹
describe ±íÃû;
11>½¨¿â
create database ¿âÃû;
12>½¨±í
use ¿âÃû£»
create table ±íÃû(
Ïà¹ØÎĵµ£º
mysqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö£¨×ܽáƪ£©
µÚÒ»½â¾ö·½·¨£º
ÂÒÂëÎÊÌâ¼òµ¥Ëµ¾ÍÊÇÊý¾Ý¿âдÈë¶ÁÈ¡£¬ÍøÒ³Îļþ£¬ÍøÒ³ÏÔʾʱ¼¸¸ö»·½ÚµÄ±àÂë²»Ò»ÖÂÔì³ÉµÄ¡£
ÂÒÂëÎÊÌâ
дÈëʱ£ºÒ³ÃæÌáȡдÈëÊý¾Ý±àÂëºÍдÈëÊý¾Ý¿âʱ±àÂë²»Ò»ÖÂ
¶Áȡʱ£º¶ÁÈ¡ºóËùÓñàÂëÓëÊý¾Ý¿âдÈëʱ²»Ò»ÖÂ
......
Ô±¾µÄÄ¿µÄÊǽ«Êý¾Ý¿â´ÓMS SQL 2000ǨÒƵ½MySQLÖУ¬µ«ÌáʾJDBCÁ¬½Óʧ°Ü£¬ÎÞÄÎÖ®¼«£¬Ö»ºÃÑ¡ÔñÖмäÇÅÁºAccessÍê³ÉÕâÏîÁîÈËÌÖÑáµÄ¹¤×÷ÁË¡£
´ó¸Å²½ÖèÈçÏ£º
1£¬´ÓMS SQL 2000½«Êý¾Ýµ¼³öµ½AccessÖУ¬ÓÐ¹Ø±í¶¨ÒåºÃÖ÷¼üºÍ×Ô¶¯±àºÅ²¿·Ö²»È»Ç¨ÒƺóÓÖµÃÐÞ¸ÄMySQLµÄ±í¡£
2£¬ÐÞ¸ÄAccess±íÖйÜÀíÔ±×é¡¢¹ÜÀíÔ±µÄȨÏÞ£¬±£Ö¤AccessµÄÄÚÖà ......
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓÃmysqlµÄclient¹¤¾ßÀ´¼ì²é¡£
ÔÚlinuxÏÂÖ´ÐÐ
/usr/local/mysql/bin/ ......
Ê×ÏÈ¿´¿´ jspÎļþ java³ÌÐòÀïÓÐûÓÐrequest.setCharacterEncoding("UTF-8");
×Ö·û±àÂëÎÊÌ⣬Êý¾Ý²åÈë¿âÖÐʱ£¬java±àÂëºÍÊý¾Ý¿â±àÂë²»Ò»Ö£¬µ¼Ö²åÈëÊý¾Ý¿âΪÂÒÂ룬¿´µ½Îª£¿£¿£¿£¿µÄÐÎʽ
½«ÄãµÄjspÒ³Ãæ±àÂë¸ÄΪGBK£¬Êý¾Ý¿â¶ÔÓ¦±íµÄ±àÂëÒ²¸ÄΪGBK
±àÂëÒ»Ö£¬¾Í²»»á³öÏÖÂÒÂëÎÊÌâÁ ......