Ubuntu 9.04 ÏÂMySQLÖÐÎÄÂÒÂëµÄ½â¾ö
Ubuntu 9.04 ÏÂÓÃÔ´°²×°ÁËMySQL¡£Ä¬ÈÏÇé¿öÏ£¬ÓÃmysql shellµÇ¼´´½¨Êý¾Ý¿â´´½¨±í²åÈëÖÐÎÄÊý¾Ýºó£¬ÓÃselect²é³öÀ´ÊÇÖÐÎÄ£¬µ«ÓÃJDBCÁ¬½Ó¾Í³öÏÖÂÒÂë¡£ÍøÉÏËÑË÷µ½½â¾ö·½·¨£¬ÈçÏ£¨Ïȱ¸·ÝÊý¾Ý£©£º
ÐÞ¸Ä/etc/mysql/my.cnf
sudo gedit /etc/mysql/my.cnf
ÔÚmy.cnfÎļþÖеÄ[client]¶ÎºÍ [mysqld]¶Î¼ÓÉÏÒÔÏÂÁ½ÐÐÄÚÈÝ£º
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
ÐèÒªÖØÆômysql·þÎñ
Í£Óãº
sudo mysqladmin shutdown -u root -p
È»ºóÊäÈëmysqlµÄrootÓû§µÄÃÜÂë
ÆôÓãº
sudo mysqld_safe -user=mysql &
²é¿´Ò»ÏÂÏÖÔÚmysqlµÄ±àÂë
sudo mysql £u root -p
mysql>show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
ÏÖÔÚ²»¹ÜÔÚmysql shellÏ»¹ÊÇJDBC¶¼¿ÉÒÔÕý³£ÏÔʾÖÐÎÄÁË¡£µ«Ö®Ç°µÄÊý¾Ý»¹ÊDz»ÐУ¬ËùÒÔÔÚÕâ֮ǰµÃÏȱ¸·ÝÊý¾Ý£¬ÐÞ¸ÄÍê±àÂëºóÔÙµ¼Èë¡£
Ïà¹ØÎĵµ£º
MYSQLÍü¼ÇROOTÃÜÂëºó£¿
ÐÞ¸ÄMySQLµÄµÇ¼ÉèÖãº
1.È¡ÏûȨÏÞ¹ÜÀí
±à¼ /mysql5.1/my.ini
ÔÚ[mysqld]µÄ¶ÎÖмÓÉÏÒ»¾ä£ºskip-grant-tables
ÀýÈ磺
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables
Ä¿µÄÊÇΪÁË£º
Ìø¹ýMySQLµÄ·ÃÎ ......
SELECT --´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
INSERT --ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐÐ
DELETE --´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐÐ
UPDATE --¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý
--Êý¾Ý¶¨Òå
CREATE TABLE --´´½¨Ò»¸öÊý¾Ý¿â±í
DROP TABLE --´ÓÊý¾Ý¿âÖÐɾ³ý±í
ALTER TABLE --ÐÞ¸ÄÊý¾Ý¿â±í½á¹¹
CREATE VIEW --´´½¨Ò»¸öÊÓͼ
DROP VIEW --´ÓÊý¾Ý¿âÖÐɾ³ýÊÓͼ ......
Ê×ÏÈ£¬´ò¿ªMySQL Query Browser£¬ÔÚµ±Ç°TestÊý¾Ý¿âÏ£¬Ð½¨Ò»¸östudent±í£¬ÓÐÈçÏÂÊôÐÔ£º
create table student (name varchar(10),id int(2),sex varchar(10));
³ÌÐò¼ûÏ£º
package com.JDBC;
import java.sql.*;
public class JDBCTest {
public static void main(String[] args) {String driver = "com.mys ......
1.1.1 MySQLÏÂÔØ¡¢°²×°ÓëÆô¶¯
ÔÚʹÓÃMySQL֮ǰ£¬ÐèÒª½¨Á¢Êý¾Ý¿âµÄ»·¾³À´´´½¨Êý¾Ý±í£¬Ê×ÏÈÎÒÃÇÐèÒª°²×°¸ÃÊý¾Ý¿â»·¾³£¬¼´MySQL¡£
1¡¢ÏÂÔØMySQL
MySQLµÄ¹Ù·½ÍøÕ¾ÊÇhttp://www.mysql.org/£¬Èçͼ2-9Ëùʾ£º
ͼ2-9 MySQL¹Ù·½ÍøÕ¾
µ±Ç°Îȶ¨°æ±¾Îª5.1£¬ÎÒÃÇÑ¡ÓÃMySQL 5.1.22×÷ΪÊý¾Ý¿â·þÎñÆ÷£¬µ½Æä¹Ù·½ ......
½ñÌì×°ÁËһ̨Linuxϵͳ£¬ÒÔÇ°¶¼ÊÇRedHat£¬ºóÀ´Ìý˵ÓÐFedoraÁË£¬Ò»Ö±Ã»Óùý¡£ÕýºÃÏîÄ¿Àï»·¾³ÒªÓþÍÏëŪһ¸öÀ´ÍæÍ棬½á¹ûÏÖÔÚÈ˼Ò×îеÄÊÇCentOS£¬¾ÍÒ»ÕÅCD£¬ÆäËûµÄ¸ù¾ÝÐèÒª×Ô¼ºÉÏÍøDown£¬£¨ÎÒ²»Ï²»¶ÕâÑù×Ó¾Í×Ô¼ºÏÂÔØDVD°æ£©¡£°²×°ÍêÖ®ºóûÓÐͼÐνçÃ棬¶øÇÒûÓÐÌáʾÊäÈërootÃÜÂ룬»¹µÃµ½µ¥Óû§Ä£Ê½ÏÂÐ޸ġ£ºóÀ´ÏÂÔØÁËÒ»¸öͼÐÎ ......