ÍêÃÀ¸ã¶¨phpMyAdmin¡°ÎÞ·¨ÔØÈëmysqlÀ©Õ¹¡±
°²×°Íêphpmyadmin
´ó¼Ò¾³£³öÏÖµÄÎÊÌâ¾ÍÊDZ¨´í£º“ÎÞ·¨ÔØÈëmysqlÀ©Õ¹£¬Çë¼ì²éphpÅäÖÔ¡£
Èç¹ûÄãʹÓõÄÊÇphp5.2ÒÔÉϵİ汾£¬Çë×¢Ò⣺php¶Ô·þÎñµÄÀ©Õ¹¹¦ÄÜ×öÁËÒ»¶¨µÄ¸Ä¶¯£¬Ò²¾ÍÊÇ˵£¬Äã°²×°phpºÍÀ©Õ¹µÄ·½Ê½Ò²Òª×öµ÷ÕûÁË¡£
Ö÷ÒªµÄµ÷ÕûÓÐÁ½·½Ã棬һÊÇPHP5.2ÒÔÉϵİ汾ÖУ¬PHP.INIÎļþÎÞÐèÌí¼Óµ½WINDOWSĿ¼Ï¡£¶þÊÇÀàÈç“mysqlÀ©Õ¹”ÕâÑùµÄ¿âÎļþC:\PHP\libmcrypt.dllÒª¸´ÖƵ½µ½C:\PHP\extĿ¼ÖУ¬¶ø²»ÊÇÏñÀÏ°æ±¾µÄ°²×°·½Ê½¸´ÖƵ½c:\windows\system32ÖС£
¾ßÌåµÄ°²×°²½ÖèÇëÄÍÐIJο¼ÏÂÎÄ£º
1.½«PHP5.2.X½âѹÖÁÄãµÄ°²×°Ä¿Â¼£¬ÈçC:\PHP
2.ÔÚapacheµÄÅäÖÃÎĵµhttp.confÎļþÖУ¬¼ÓÈëÒÔÏ´úÂ룬ʹapacheÄܽ«phpÒÔÄ£¿é·½Ê½¼ÓÔØ£º
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
3.ÔÚapacheµÄÅäÖÃÎĵµhttp.confÎļþÖУ¬¼ÓÈëÒÔÏ´úÂ룬ָ¶¨PHP.INIÎļþµÄËùÔÚĿ¼£º
PHPIniDir "C:/php"
4.½«PHP.INI-DIST¸üÃûΪPHP.INI£¬²¢±à¼C:\PHP\PHP.INIÎļþ£º
ÕÒµ½extension_dir = "./"
¸ü¸ÄΪextension_dir = "C:\php\ext"
ÕÒµ½;extension=php_mysql.dll
È¥µôÇ°ÃæµÄ·ÖºÅ¡£
5.ÏÖÔÚÊÇ×îÖØÒªµÄ²½Ö裬Çë×¢Ò⣺¸´ÖÆC:\PHP\libmysql.dllÖÁC:\PHP\extĿ¼ÏÂ,ÓÃÀ´Ö§³ÖMYSQLÀ©Õ¹¿â£¬
²¢ÔÚAPACHE2.2µÄÅäÖÃÎļþÖмÓÈë
LoadFile C:\php\php5ts.dll
LoadFile C:\php\libmysql.dll
6.ÖØÆôWEB·þÎñ
7.IISÓû§£¬¸ü¸ÄÄÚÈÝͬÉÏ£¬ÐèÒª°ÑPHP.INIÎļþ¸´ÖƵ½%STSTEMROOT%ÏÂ
Íê³ÉÒÔÉϲÙ×÷ºóÖØÆô·þÎñ¡£
µ±ÅäÖÃÍê±ÏËùÓзþÎñºó£¬°²×°PhpMyAdmin£¬»áÓгöÏÖ“ÎÞ·¨ÔØÈë mcrypt À©Õ¹£¬<br />Çë¼ì²é PHP ÅäÖÔµÄÌáʾ£¬Õë¶ÔÕâ¸öÎÊÌâµÄ½â¾ö°ì·¨ÊÇ£º
1.±à¼APACHE2.2.XµÄÅäÖÃÎļþHTTPD.CONFÖÐÌí¼ÓLoadFile C:\php\libmcrypt.dll
2.¸´ÖÆC:\PHP\libmcrypt.dllµ½C:\PHP\ext£¬ÓÃÓÚÍêÕûÀ©Õ¹Îļþ¡£
3.±à¼C:\PHP\PHP.INIÎļþ£¬ÕÒµ½;extension=php_mcrypt.dll£¬È¥µôÇ°Ãæ·ÖºÅ";"
Èç¹û£¬°²×°PhpMyAdminʱҲ³öÏÖ--“ûÓз¢ÏÖ PHP µÄÀ©Õ¹ÉèÖÃmbstring£¬ ¶øµ±Ç°ÏµÍ³ºÃÏñÔÚʹÓÿí×Ö·û¼¯£»Ã»ÓÐ mbstring À©Õ¹µÄ phpMyAdmin ²»ÄÜÕýȷʶ±ð×Ö·û´®£¬¿ÉÄܲúÉú²»¿ÉÒâÁϵĽá¹û”µÄÌáʾ£¬Õë¶ÔÕâ¸öÎÊÌâµÄ½â¾ö°ì·¨ÊÇ£º
±à¼C:\PHP\PHP.INIÕÒµ½;extension=php_mbstring.dll£¬È¥µôÇ°ÃæµÄ·ÖºÅ";"
Íê³ÉÒÔÉϲÙ×÷ºóÔÙ´ÎÖØÆô·þÎñ¡£
×îºó£¬ÊÇʹÓÃPHPMYADMIN3Ç°µÄһЩ»ù±¾°ÑÅäÖã¬Õâ¸öÅäÖÃÊÇÕë¶ÔphpMyadmin3.0ÒÔÉϵİ汾
Ïà¹ØÎĵµ£º
--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ÁË
ÁíÍâ×¢ÒâÄãµÄ½Å±¾ÀÓÐûÓиø¿â±íÉèÖ ......
<>ÕûÀíÁËÒÔÏÂËÄÖÖÔÚ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 ......
MySQLµÄtimestampÀàÐÍ×Ô¶¯¸üÐÂÎÊÌâ
½ñÌ콨ÁËÒ»¸ö±í£¬ÀïÃæÓÐÒ»¸öÁÐÊÇtimestampÀàÐÍ£¬ÎÒ±¾ÒâÊÇÔÚÊý¾Ý¸üÐÂʱ£¬Õâ¸ö×ֶεÄʱ¼äÄÜ×Ô¶¯¸üС£ÆñÖª¶ÔÕâ¸öÀàÐ͵ÄÖµ»¹²»ÉõÁ˽⣬µ¼Ö³ö´í¡£·¢ÏÖÕâ¸ö×Ö¶ÎÖ»ÊÇÔÚÕâÐÐÊý¾Ý½¨Á¢µÄʱºòÓÐÖµ£¬ÔÚ¸üеÄÈ´Îޱ仯¡£
²éÕÒ×ÊÁÏ£¬·¢ÏÖÊÇÎÒ½¨±íµÄÓï¾äÓÐÎÊÌ⣺
ÒÔÏÂÊÇ´ú ......