MYSQL¸ß²¢·¢¼Ü¹¹
L1¡¢HTML¾²Ì¬»¯
Æäʵ´ó¼Ò¶¼ÖªµÀ£¬Ð§ÂÊ×î¸ß¡¢ÏûºÄ×îСµÄ¾ÍÊÇ´¿¾²Ì¬»¯µÄhtmlÒ³Ã棬ËùÒÔÎÒÃǾ¡¿ÉÄÜʹÎÒÃǵÄÍøÕ¾ÉϵÄÒ³Ãæ²É Óþ²Ì¬Ò³ÃæÀ´ÊµÏÖ£¬Õâ¸ö×î¼òµ¥µÄ·½·¨ÆäʵҲÊÇ×îÓÐЧµÄ·½·¨¡£µ«ÊǶÔÓÚ´óÁ¿ÄÚÈݲ¢ÇÒƵ·±¸üеÄÍøÕ¾£¬ÎÒÃÇÎÞ·¨È«²¿ÊÖ¶¯È¥°¤¸öʵÏÖ£¬ÓÚÊdzöÏÖÁËÎÒÃdz£¼ûµÄÐÅÏ¢ ·¢²¼ÏµÍ³CMS£¬ÏñÎÒÃdz£·ÃÎʵĸ÷¸öÃÅ»§Õ¾µãµÄÐÂÎÅƵµÀ£¬ÉõÖÁËûÃǵÄÆäËûƵµÀ£¬¶¼ÊÇͨ¹ýÐÅÏ¢·¢²¼ÏµÍ³À´¹ÜÀíºÍʵÏֵģ¬ÐÅÏ¢·¢²¼ÏµÍ³¿ÉÒÔʵÏÖ×î¼òµ¥µÄÐÅϢ¼ Èë×Ô¶¯Éú³É¾²Ì¬Ò³Ã棬»¹Äܾ߱¸ÆµµÀ¹ÜÀí¡¢È¨ÏÞ¹ÜÀí¡¢×Ô¶¯×¥È¡µÈ¹¦ÄÜ£¬¶ÔÓÚÒ»¸ö´óÐÍÍøÕ¾À´Ëµ£¬ÓµÓÐÒ»Ì׸ßЧ¡¢¿É¹ÜÀíµÄCMSÊDZز»¿ÉÉٵġ£
³ýÁËÃÅ»§ºÍÐÅÏ¢·¢²¼ÀàÐ͵ÄÍøÕ¾£¬¶ÔÓÚ½»»¥ÐÔÒªÇóºÜ¸ßµÄÉçÇøÀàÐÍÍøÕ¾À´Ëµ£¬¾¡¿ÉÄܵľ²Ì¬»¯Ò²ÊÇÌá¸ßÐÔÄܵıØÒªÊֶΣ¬½«ÉçÇøÄÚµÄÌû×Ó¡¢ÎÄÕ½øÐÐʵʱµÄ¾²Ì¬»¯£¬ÓиüеÄʱºòÔÙÖØо²Ì¬»¯Ò²ÊÇ´óÁ¿Ê¹ÓõIJßÂÔ£¬ÏñMopµÄ´óÔÓ»â¾ÍÊÇʹÓÃÁËÕâÑùµÄ²ßÂÔ£¬ÍøÒ×ÉçÇøµÈÒ²ÊÇÈç´Ë¡£
ͬ ʱ£¬html¾²Ì¬»¯Ò²ÊÇijЩ»º´æ²ßÂÔʹÓõÄÊֶΣ¬¶ÔÓÚϵͳÖÐƵ·±Ê¹ÓÃÊý¾Ý¿â²éѯµ«ÊÇÄÚÈݸüкÜСµÄÓ¦Ó㬿ÉÒÔ¿¼ÂÇʹÓÃhtml¾²Ì¬»¯À´ÊµÏÖ£¬±ÈÈçÂÛ̳ÖÐÂÛ Ì³µÄ¹«ÓÃÉèÖÃÐÅÏ¢£¬ÕâЩÐÅϢĿǰµÄÖ÷Á÷ÂÛ̳¶¼¿ÉÒÔ½øÐкǫ́¹ÜÀí²¢ÇÒ´æ´¢ÔÙÊý¾Ý¿âÖУ¬ÕâЩÐÅÏ¢Æäʵ´óÁ¿±»Ç°Ì¨³ÌÐòµ÷Ó㬵«ÊǸüÐÂƵÂʺÜС£¬¿ÉÒÔ¿¼Âǽ«Õⲿ·Ö ÄÚÈݽøÐкǫ́¸üеÄʱºò½øÐо²Ì¬»¯£¬ÕâÑù±ÜÃâÁË´óÁ¿µÄÊý¾Ý¿â·ÃÎÊÇëÇó¡£
2¡¢Í¼Æ¬·þÎñÆ÷·ÖÀë
´ó¼ÒÖªµÀ£¬¶ÔÓÚWeb·þÎñÆ÷À´Ëµ£¬²»¹Ü ÊÇ Apache¡¢IIS»¹ÊÇÆäËûÈÝÆ÷£¬Í¼Æ¬ÊÇ×îÏûºÄ×ÊÔ´µÄ£¬ÓÚÊÇÎÒÃÇÓбØÒª½«Í¼Æ¬ÓëÒ³Ãæ½øÐзÖÀ룬ÕâÊÇ»ù±¾ÉÏ´óÐÍÍøÕ¾¶¼»á²ÉÓõIJßÂÔ£¬ËûÃǶ¼ÓжÀÁ¢µÄͼƬ·þ ÎñÆ÷£¬ÉõÖÁºÜ¶ą̀ͼƬ·þÎñÆ÷¡£ÕâÑùµÄ¼Ü¹¹¿ÉÒÔ½µµÍÌṩҳÃæ·ÃÎÊÇëÇóµÄ·þÎñÆ÷ϵͳѹÁ¦£¬²¢ÇÒ¿ÉÒÔ±£Ö¤ÏµÍ³²»»áÒòΪͼƬÎÊÌâ¶ø±ÀÀ££¬ÔÚÓ¦Ó÷þÎñÆ÷ºÍͼƬ·þÎñÆ÷ ÉÏ£¬¿ÉÒÔ½øÐв»Í¬µÄÅäÖÃÓÅ»¯£¬±ÈÈçapacheÔÚÅäÖÃContentTypeµÄʱºò¿ÉÒÔ¾¡Á¿ÉÙÖ§³Ö£¬¾¡¿ÉÄÜÉÙµÄLoadModule£¬±£Ö¤¸ü¸ßµÄϵͳÏûºÄ ºÍÖ´ÐÐЧÂÊ¡£
3¡¢Êý¾Ý¿â¼¯ÈººÍ¿â±íÉ¢ÁÐ
´óÐÍÍøÕ¾¶¼Óи´ÔÓµÄÓ¦Óã¬ÕâЩӦÓñØÐëʹÓÃÊý¾Ý¿â£¬ÄÇôÔÚÃæ¶Ô´óÁ¿·ÃÎʵÄʱºò£¬Êý¾Ý¿âµÄÆ¿¾±ºÜ¿ì¾ÍÄÜÏÔÏÖ³öÀ´£¬Õâʱһ̨Êý¾Ý¿â½«ºÜ¿ìÎÞ·¨Âú×ãÓ¦Óã¬ÓÚÊÇÎÒÃÇÐèҪʹÓÃÊý¾Ý¿â¼¯Èº»òÕß¿â±íÉ¢ÁС£
ÔÚÊý¾Ý¿â¼¯Èº·½Ã棬ºÜ¶àÊý¾Ý¿â¶¼ÓÐ×Ô¼ºµÄ½â¾ö·½°¸£¬Oracle¡¢SybaseµÈ¶¼Óкܺõķ½°¸£¬³£ÓõÄMySQLÌṩµÄMaster/SlaveÒ²ÊÇÀàËƵķ½°¸£¬ÄúʹÓÃÁËʲôÑùµÄDB£¬¾Í²Î¿¼ÏàÓ¦µÄ½â¾ö·½°¸À´ÊµÊ©¼´¿É¡£
ÉÏ ÃæÌáµ½µÄÊý¾Ý¿â¼¯ÈºÓ
Ïà¹ØÎĵµ£º
--default-character-set=utf8 ÓëÐÞ¸ÄsqlÎļþ¼ÓÈ룺SET NAMES 'utf8';
µ¼Èë½Å±¾Ê±£¬SET NAMES 'xxx' £¬xxxÓ¦¸ÃºÍsql½Å±¾ÎļþµÄʵ¼Ê±àÂëÒ»Ö£¬Èç¹ûÄãÉèÖõÄʱutf-8 £¬ÄÇôÇëÈ·ÈÏÄãµÄsql½Å±¾Îļþʱutf-8±£´æµÄ:
iconv -f UTF-8 xxx.sql
Èç¹ûÏÔʾÕý³££¬ÄÇôÕâÒ»²½¾ÍOKÁË
ÁíÍâ×¢ÒâÄãµÄ½Å±¾ÀÓÐûÓиø¿â±íÉèÖ ......
Dos½øÈëMySqlµÄbinĿ¼,Ö´ÐУºmysqldump -hÔ¶³ÌÊý¾Ý¿âIP Êý¾Ý¿âÃû×Ö -uÔ¶³ÌÊý¾Ý¿âÓû§Ãû -pÔ¶³ÌÊý¾Ý¿âÃÜÂë --add-drop-table | mysql ±¾µØÊý¾Ý¿âÃû×Ö -u±¾µØÊý¾Ý¿âÓû§Ãû -p±¾µØÊý¾Ý¿âÃÜÂë
ÔÚ¾ÖÓòÍøÄÚ²âÊԳɹ¦ ......
<>ÕûÀíÁËÒÔÏÂËÄÖÖÔÚMySQLÖÐÐÞ¸ÄrootÃÜÂëµÄ·½·¨,¿ÉÄܶԴó¼ÒÓÐËù°ïÖú!
·½·¨1£º ÓÃSET PASSWORDÃüÁî
¡¡¡¡mysql -u root
¡¡¡¡mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
·½·¨2£ºÓÃmysqladmin
¡¡¡¡mysqladmin -u root password "newpass"
¡¡¡¡Èç¹ûrootÒѾÉèÖà ......
6
¡¢ÐÞ¸ÄÊý¾Ý¿âµÄ×Ö·û¼¯
mysql>use mydb
mysql>alter database mydb character set utf-8;
6
¡¢´´½¨Êý¾Ý¿âÖ¸¶¨Êý¾Ý¿âµÄ×Ö·û¼¯
mysql>create database mydb character set utf-8;
ͨ¹ýÅäÖÃÎļþÉèÖô´½¨Êý¾Ý¿âʱ×Ö·û¼¯:
#vi /var/lib/mysql/mydb/db.opt
default-character-set=latin1
default-col ......
<?php
/**
* Mysql DB
*
* @author Administrator
* @package defaultPackage
*/
class MySqlDB{
private $_db;
private static $_instance;
private function __construct(&$db_type){
global $connectionstr;
$conn_db=$connectionstr[$db_type];
$this->_db=mysql_pconnect($conn ......