²é¿´¼°ÐÞ¸ÄmysqlÊý¾Ý¿âµÄĬÈϱàÂë2
ʹÓÃmysql ¾³£»áÓöµ½±àÂëÎÊÌ⣬¶øµ¼Ö³ÌÐò³öÏÖÂÒÂë,mysql ÔÚÒÔϼ¸¸öµØ·½»áÉæ¼°µ½±àÂë¸ñʽ
Êý¾Ý¿â±àÂë
·þÎñÆ÷±àÂë
Á¬½Ó±àÂë
¿Í»§¶Ë±àÂë
ÏÂÃæÊÇÒ»¸öµäÐ͵ÄʾÀý£¬ ÔËÐÐ mysql -u root
²é¿´±àÂë mysql>status
mysql Ver 14.7 Distrib 4.1.14, for Win32 (ia32)
Connection id: 90
Current database: yitian
Current user: ODBC@localhost
SSL: Not in use
Using delimiter: ;
Server version: 4.1.14
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: gbk
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3306
Uptime: 1 hour 28 min 21 sec
Server characterset: latin1 ·þÎñÆ÷ʹÓõıàÂëΪ latin1
Db characterset: gbk Êý¾Ý¿â yitianµÄ±àÂëΪ GBK
Client characterset: latin1 client ¶ËΪ latin1
Conn. characterset: latin1 Á¬½ÓµÄ±àÂëΪ latin
Èç¹ûÎÒÃÇҪʹÓÃÖ§³ÖÖÐÎÄµÄ gbk Êý¾Ý¿â£¬ ¾ÍÒªÔÚ´´½¨Êý¾Ý¿âʱ£¬Ê¹ÓÃÏÂÃæµÄÓï·¨
GBK ʹÓÃ
CREATE DATABASE yitian DEFAULT CHARACTER SET gbk
COLLATE gbk_chinese_ci;
utf8 ʹÓÃ
CREATE DATABASE IF NOT EXISTS yitian default charset
utf8 COLLATE utf8_general_ci;
Èç¹ûÒªÐÞ¸ÄÒÑ´æÔÚµÄÊý¾Ý¿âÉèÖÃʹÓÃ
alter database testdb character set
utf8
È»ºóÔÚ³ÌÐòÖÐÁ¬½ÓʱҲӦ¸ÃÉ趨ÏàÓ¦µÄ×Ö·û¼¯ , ʹÓÃ
SET CHARACTER SET GBK;
ÕâʱÔٲ鿴¿´Ï±àÂë
mysql>status
mysql Ver 14.7 Distrib 4.1.14, for Win32 (ia32)
Connection id: 90
Current database: yitian
Current user: ODBC@localhost
SSL: Not in use
Using delimiter: ;
Server version: 4.1.14
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: gbk
Client characterset: gbk
Conn. characterset: gbk
TCP port: 3306
Uptime: 1 hour 33 min 22 sec
¾Í¿ÉÒÔʹÓóÌÐòÕýȷдÈëºÍ¶ÁÈ¡Êý¾ÝÁË
Èç¹ûÒª¸Ä±äÊý¾Ý¿âµÄĬÈϱàÂë¿ÉÒÔÐÞ¸Ä my.ini
ÉèÖÃ my.ini
#default-character-set=GBK
default-character-set = UTF8
Ïà¹ØÎĵµ£º
ÔÚmysqlÊý¾Ý¿âÖУ¬Ê¹ÓõÄÊÇlatin×Ö·û¼¯£¬ËùÒÔÎÞ·¨Õý³£µÄÖ§³ÖÖÐÎÄ×Ö·û£¬ÖÐÎÄÔÚÊý¾Ý¿âÖÐÏÔʾΪÂÒÂë“£¿”ºÅ¡£ÎªÁËÈÃmysql¿ÉÒÔÕý³£Ê¹ÓÃÖÐÎÄ£¬ÓÈÆäÊǵ±Ê¹ÓÃjspÁ¬½ÓmysqlµÄʱºò£¬ÎÒÃÇÐèҪʹÓÃgbkµÄ×Ö·û¼¯£¬Òò´ËÎÒÃÇÒª¶Ômysql½øÐÐÒÔÏÂÉèÖã¬ÒÔ±ãÆäÓÐЧµÄÖ§³ÖÖÐÎÄ£º
IXDBA.NET¼¼ÊõÉçÇø
1.ÐÞ¸Ämy.cnfÎļþ
my.cnfÎļþÊÇ ......
½â¾öMySQL²»ÔÊÐí´ÓÔ¶³Ì·ÃÎʵķ½·¨
2009-06-04 13:11
1¡£ ¸Ä±í·¨¡£¿ÉÄÜÊÇÄãµÄÕʺŲ»ÔÊÐí´ÓÔ¶³ÌµÇ½£¬Ö»ÄÜÔÚlocalhost¡£Õâ¸öʱºòÖ»ÒªÔÚlocalhostµÄÄÇ̨µçÄÔ£¬µÇÈëmysqlºó£¬¸ü¸Ä "mysql" Êý¾Ý¿âÀïµÄ "user" ±íÀïµÄ "host" Ï´Ó"localhost"¸Ä³Æ"%"
Sql´úÂë ¸´ÖÆ´úÂë
1. mysql -u root -pvmwaremysql>us ......
1.Á¬½ÓMySQLÊý¾Ý¿â
echo on¡¡¡¡
cd c:\Program Files\MySQL\MySQL Server 5.2\bin
mysql -uroot -ppass
2¡¢ÏÔʾÊý¾Ý¿âÁÐ±í¡£
show databases;
3¡¢ÏÔʾ¿âÖеÄÊý¾Ý±í£º
use mysql; //´ò¿ª¿â£¬
show tables;
4¡¢ÏÔʾÊý¾Ý±íµÄ½á¹¹£º
describe ±íÃû;
5¡¢½¨¿â£º
create database ¿âÃû;
6¡¢½¨±í£º
use ¿âÃû;
creat ......
¿ÉÒÔ½«Õâ¸ö½Å±¾·Å½øcrontab£¬ËûµÄÅäÖÆÎļþÔÚ /etc/crontabÖÐÿÌìÁ賿ִÐÐÒ»´Î£¬×Ô¶¯±¸·Ý Õâ¸ö½Å±¾Ã¿Ìì×î¶àÖ»Ö´ÐÐÒ»´Î£¬¶øÇÒÖ»±£Áô×î½üÎåÌìµÄ±¸·ÝÔÚ·þÎñÆ÷ÉÏ¡£
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by aspbiz
#2004-09
#Setting
#ÉèÖÃÊý¾Ý¿âÃû£¬Êý¾Ý¿âµÇ¼Ãû£¬ÃÜÂ룬±¸·Ý·¾¶£¬ÈÕ־ ......
Æô¶¯mysql: /etc/rc.d/init.d/mysql start
ÐÞ¸ÄÃÜÂë: ¸ñʽ£ºmysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
ʹÓÃÃÜÂëµÇ¼: mysql -u root -p
ÏÔʾÊý¾Ý¿â: show databases;
Ñ¡ÔñÊý¾Ý¿â: use Êý¾Ý¿âÃû;
ÏÔʾ±í: show tables;
ÏÔʾ±í½á¹¹: descibe ±íÃû;
Ô¶³ÌµÇ¼mysqlÐèÒª¿ªÆôÈ ......