ʹÓÃMYSQLÊý¾Ý¿â²åÈëͼƬʱ¹ØÓÚÊý¾Ý¿â×Ö·û¼¯µÄ´íÎó
ÔÚʹÓÃJDBC²Ù×÷Êý¾Ý¿â ÔÚÏòÊý¾Ý¿âÖвåÈëͼƬʱ£¬³ÌÐòÀÏÊÇÅ×Òì³£
ÔÀ´µÄMYSQL×Ö·û¼¯ÊÇGBK µ«ÊÇÕâÖÖ×Ö·û¼¯ËäȻ֧³ÖÖÐÎÄ µ«Êǵ±²åÈëͼƬµÈ¶þ½øÖÆÊý¾Ýʱ »á³öÏÖ´íÎó
½â¾ö·½·¨£º
½«Êý¾Ý¿â×Ö·û¼¯¸ü¸ÄΪgb2312»òutf-8
1.ÔÚMYSQL DOS½çÃæÖÐÊäÈë show variables like "%char%";
+--------------------------+---------------+
| Variable_name | Value |
+--------------------------+---------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
+--------------------------+---------------+
1
¡¢ÐÞ¸ÄÊý¾Ý¿âĬÈÏ×Ö·û¼¯£º
´ò¿ªC:\Program Files\MySQL\MySQL Server 5.0
ÀïÃæµÄmy.ini
ÎļþÕÒµ½Õâ¶ÎÎÄ×Ö£º
ÒýÓÃ
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=latin1
°Ñdefault-character-set=latin1
¸ÄΪdefault-character-set=gb2312
2
¡¢Èç¹ûÄãÊǵ¼ÈëµÄÊý¾Ý¿â£¬ÐèÒª¶Ômy.ini
×öÈçÏÂÐÞ¸ÄÕÒµ½
ÒýÓÃ
[client
Ïà¹ØÎĵµ£º
Ò»¡¢°²×°ÏµÍ³»·¾³
1¡¢ÏµÍ³£ºcentos5
2¡¢²âÊÔÔÚvm5.5
×¼±¸Èí¼þ
lighttpd-1.4.18
ÏÂÔصØÖ·
mysql-5.0.41
part1ÏÂÔصØÖ·
part2ÏÂÔصØÖ·
part3ÏÂÔصØÖ·
php-5.2.3
ÏÂÔصØÖ·
SupeSite/X-Space
part1ÏÂÔصØÖ·
part2ÏÂÔصØÖ·
part3ÏÂÔصØÖ·
discuz
ÏÂÔصØÖ·
¶þ¡¢´î½¨web·þÎñÆ÷°²×°¹ý³Ì
1¡¢mysql5°²×°
$ tar zx ......
use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
1.ͨ¹ýÐÞ¸ÄMYSQLÊý¾Ý¿âÖÐMYSQL¿âµÄUSER±í
¾ÍÓÃÆÕͨµÄUPDATE¡¢INSERTÓï¾ä¾Í¿ÉÒÔ
2.ÔÚÃüÁîÐÐÖÐʹÓÃÈçÏÂÃüÁî
MYSQLADMIN -u root -p PASSWORD mypasswd
3.¿ÉÒÔÐÞ¸ÄMYSQLÎļþ¼ÐÖеÄMY.INIÎļþ
4.ʹÓÃSET PASSWORDÓï¾ ......
Õâ¶Îʱ¼ä±»Õâ¸öÀ§ÈÅÁ˺ܾã¬Í¨¹ýÐÞ¸ÄÅäÖÃÎļþ£¬ÖÕÓÚ°ÑÕâ¸öÎÊÌâ½â¾öÁË¡£
×Ô¼ºÔÚÍøÉÏÒ²ÕÒÁ˺ܶà¹ØÓÚ½â¾öÕâ¸öÎÊÌâµÄ·½·¨£¬µ«ÊǶ¼½²µÄ²»Ì«Çå³þ£¬ËùÒÔ½ñÌìÔÚÕâÖØÐÂ˵ÏÂÕâ¸öÎÊÌâ¡£
ÎҵĽâ¾ö·½·¨ÊÇͨ¹ýÐÞ¸ÄmysqlµÄÅäÖÃÎļþmy.ini£¬·½·¨ÈçÏ£º
ÔÚmy.iniÖпÉÒÔ·¢ÏÖÓÐÕâôһ¶Î´úÂ룺
[client]
port=3306
[mysql]
default ......
´Óhttp://hackmysql.com/mysqlslaÏÂÔØmysqlsla£¬µ±Ç°×îаæΪ£º2.03
tar zxvf mysqlsla-2.03.tar.gz
cp mysqlsla-2.03/bin/mysqlsla /usr/local/bin
Èç¹ûÌáʾ“Can’t locate DBI.pm”£¬Ö´ÐÐÒÔÏÂÃüÁî
yum install perl-DBI perl-DBD-MySQL -y
Õâʱ¾Í¿ÉÒÔʹÓÃmysqlslaÁË£¬Ó÷¨ÈçÏÂ
mysqlsla -lt slo ......