UbuntuÉÏMySQL°²×°Ö¸ÄÏ
Òª°²×° MySQL£¬¿ÉÒÔÔÚÖÕ¶ËÌáʾ·ûºóÔËÐÐÏÂÁÐÃüÁ
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// °²×°php5-mysql Êǽ«phpºÍmysqlÁ¬½ÓÆðÀ´
Ò»µ©°²×°Íê³É£¬MySQL ·þÎñÆ÷Ó¦¸Ã×Ô¶¯Æô¶¯¡£Äú¿ÉÒÔÔÚÖÕ¶ËÌáʾ·ûºóÔËÐÐÒÔÏÂÃüÁîÀ´¼ì²é MySQL ·þÎñÆ÷ÊÇ·ñÕýÔÚÔËÐУº
sudo netstat -tap | grep mysql
µ±ÄúÔËÐиÃÃüÁîʱ£¬Äú¿ÉÒÔ¿´µ½ÀàËÆÏÂÃæµÄÐУº
tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
Èç¹û·þÎñÆ÷²»ÄÜÕý³£ÔËÐУ¬Äú¿ÉÒÔͨ¹ýÏÂÁÐÃüÁîÆô¶¯Ëü£º
sudo /etc/init.d/mysql restart
½øÈëmysql
$mysql -uroot -p ¹ÜÀíÔ±ÃÜÂë
ÅäÖà MySQL µÄ¹ÜÀíÔ±ÃÜÂ룺
sudo mysqladmin -u root password newpassword
Ïà¹ØÎĵµ£º
1.struts.xmlÖÐÉèÖÃ
<constant name="struts.il8n.encoding" value="UTF-8"></constant>
2.jspÒ³ÃæÉèÖÃ
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
3.Êý¾Ý¿âÁ¬½Óurl
jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=u ......
MySQLʶ±ðÏÂÁÐתÒå×Ö·û£º
\0
Ò»¸öASCII 0 (NUL)×Ö·û¡£
\n
Ò»¸öÐÂÐзû¡£
\t &nb ......
mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ
//Ö÷¼ü549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ549830479
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default ......
1.µÇ¼MySQLÖÕ¶Ë 2.ÊÚȨ:
ÔÊÐíËùÓлúÆ÷·ÃÎÊMySQL·þÎñÆ÷
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH RIVILEGES;
ÔÊÐíÖ¸¶¨»úÆ÷·ÃÎÊMySQL·þÎñÆ÷
GRANT ALL PRIVILEGES ON *.* TO 'root'@'IPµØÖ·'IDENTIFIED BY 'password' WITH GRANT OPTION; ......
* mysqlÊ×ÏȽ«Äõ½µÄÊý¾Ýת»»Îªcharacter_set_clientÖ¸¶¨µÄ±àÂë¸ñʽ£¬È»ºóת»»Îª character_set_connectionÖ¸¶¨µÄ¸ñʽ£¬×îºóÔÙ½«Êý¾Ý´æ´¢µ½Êý¾Ý¿â£¬´æ´¢¸ñʽΪcharacter_set_databaseËùÖ¸¶¨µÄ¸ñʽ£»
* ´ÓÊý¾Ý¿â¶ÁÊý¾Ýʱ£¬½«Êý¾Ý¿â¸ñʽת»»Îªcharacter_set_resultsÖ¸¶¨µÄ¸ñʽ£¬ÔÙ·¢Ë ......