ubuntuÖÐmysqlÂÒÂëÎÊÌâ
ÏÈ¿´ÏÂÃæ×¢ÒâÄÚÈÝ
ÕûÕûŪÁËÒ»Ì죬ÖÕÓÚ½â¾öÁËjdbc(mysql-connector-java-5.0.30)ºÍmysqͨÐÅÖÐÎÄÂÒÂëµÄÎÊÌ⣡ÎÒµÄϵͳÊÇ
linux£¨ubuntu£©¡£ÔÚjavaÖУ¨Myeclipse»·¾³£©Ê¹ÓÃhibernateÁ¬½Ómysql¡£´æ´¢Ó¢ÎÄûÎÊÌ⣬д£¨insert
into£©ºÍ¶Á£¨select£©¶¼ÄÜÕýÈ·ÏÔʾ£¬µ«ÊÇÈôÆäÖдøÓÐÖÐÎÄ×Ö·û¾Í³ÉÂÒÂëÁË¡£µ½ÍøÉϲéÕÒÁË°ëÌì×ÊÁÏ£¬×îºó
ÖÕÓڳɹ¦¡£
ÎҵĽâ¾ö·½·¨ÊÇ£¬ÔÚ/etc/my.cnfÎļþÖмÓÉÏÒÔÏÂÁ½ÐÐÄÚÈÝ£º
[client]default-character-set=utf8[mysqld]default-character-set=utf8
×¢Ò⣬Õâ¸öÎļþ²»Ò»¶¨´æÔÚ£¬Ð轫 /°²×°ÔÎļþ/support-files/my-medium.cnf ¸´ÖƵ½/etc/Ï£¬ÖØÃüÃû
ÐèÖØÆômysql
Í£Óãºsudo /usr/local/mysql/bin/mysqladmin shutdown
ÆôÓÃsudo /usr/local/mysql/bin/mysqld_safe -user=mysql &
²é¿´mysql±àÂë
ÆôÓúósudo /usr/local/mysql/bin/mysql
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/ |
-------------------------- ----------------------------
×¢Ò⣬ÕâÑù¸Ä±äºóÔÏÈËù½¨Êý¾Ý¿âËƺõ²»ÄÜÓ㨲»È·¶¨£©£¬¾¡Á¿±¸·Ý
н¨Êý¾Ý¿â£¬¾Í²»»áÓÐÂÒÂëÁË¡£
screen.width*0.7)
{this.resized=true; this.width=screen.width*0.7; this.alt='Click here
to open new window\nCTRL Mouse wheel to zoom in/out';}"
onmouseover="if(this.width>screen.width*0.7) {this.resized=true;
this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click
here to open new window\nCTRL Mouse wheel to zoom in/out';}"
onclick="if(!this.resiz
Ïà¹ØÎĵµ£º
Ò»¡¢MySQL »ñµÃµ±Ç°ÈÕÆÚʱ¼ä º¯Êý
1.1 »ñµÃµ±Ç°ÈÕÆÚ+ʱ¼ä£¨date + time£©º¯Êý£ºnow()
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-08-08 22:20:46 |
+---------------------+
³ýÁË now() º¯ÊýÄÜ»ñµÃµ±Ç°µÄÈÕÆÚʱ¼äÍ⣬MySQL Öл¹ÓÐÏÂÃæµÄº¯Êý£º
current_tim ......
ÕâÁ½ÌìÎÒ×°ÁËUBUNTU £¬ÔÚ±àÒë°²×°MYSQLµÄʱºòûÓгöʲôÎÊÌ⣬
µ½scripts/mysql_install_db --user=mysql
ÕâÒ»²½Ê±£¬µÃµ½ÈçÏ´íÎó
FATAL ERROR: Can't find mysqld. Please specify your installation
directory with the '--basedir=' option.
FATAL ERROR: Could not find SQL file '/fill_help_tables.sql'
µ½ÍøÉ ......
groupadd mysql
н¨Ò»¸öÃûΪmysqlµÄÓû§×é
useradd -g mysql mysql
ÔÚmysqlÓû§×éÏÂн¨Ò»¸öÃûΪmysqlµÄÓû§
gunzip ½âѹÏÂÔص½µÄ.gzÎļþ
cd mysql-VERSION
½øÈë½âѹºóµÄĿ¼
CFLAGS="-O3 -mcpu=pentium4" CXX=gcc CXXFLAGS="-O3 -march=pentium4 -felide-constructors -fno-exceptions -fno-rtti" ./configu ......
CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]
¸ÃÓï¾äÄÜ´´½¨ÐµÄÊÓͼ£¬Èç¹û¸ø¶¨ÁËOR REPLACE×Ӿ䣬¸ÃÓï¾ä»¹ÄÜÌæ»»ÒÑÓеÄÊÓͼ¡£select_st ......
¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW())&nbs ......