mysql³£ÓÃÖ¸ÁºÏ
Java´úÂë
mysql> select version(),current_date;
²éѯmysqlµÄ°æ±¾ºÅ ºÍ ÈÕÆÚ
mysql> select version();
²éѯmysqlµÄ°æ±¾ºÅ
select now();
²éѯµ±Ç°ÈÕÆÚºÍ׼ȷµÄʱ¼ä
Java´úÂë
mysql> select version(),current_date;
²éѯmysqlµÄ°æ±¾ºÅ ºÍ ÈÕÆÚ
mysql> select version();
²éѯmysqlµÄ°æ±¾ºÅ
select now();
²éѯµ±Ç°ÈÕÆÚºÍ׼ȷµÄʱ¼ä
mysql> select version(),current_date;
²éѯmysqlµÄ°æ±¾ºÅ ºÍ ÈÕÆÚ
mysql> select version();
²éѯmysqlµÄ°æ±¾ºÅ
select now();
²éѯµ±Ç°ÈÕÆÚºÍ׼ȷµÄʱ¼ä
н¨»òɾ³ýÒ»¸öÊý¾Ý¿â
Java´úÂë
Mysql>create database mydb;
Mysql> drop database mydb;
Java´úÂë
Mysql>create database mydb;
Mysql> drop database mydb;
Mysql>create database mydb;
Mysql> drop database mydb;
´ò¿ªµÄÊý¾Ý¿âµÄÃüÁî
Java´úÂë
mysql> use mysql
Database changed
Java´úÂë
mysql> use mysql
Database changed
mysql> use mysql
Database changed
²é¿´Êý¾Ý¿âµÄÃüÁî
Java´úÂë
mysql> show databases;
Java´úÂë
mysql> show databases;
mysql> show databases;
²é¿´Êý¾Ý±íµÄÏêϸ½á¹¹
(usersÊÇ ±íÃû)
Java´úÂë
mysql> desc users;
Java´úÂë
mysql> desc users;
mysql> desc users;
н¨Êý¾Ý¿â
Java´úÂë
mysql> create database school;
Query OK, 1 row affected (0.00 sec)
Java´úÂë
mysql> create database&n
Ïà¹ØÎĵµ£º
1.µÇ¼£º mysql -uroot -p
2.LinuxÏÂmysql ²»ÄÜÍâÍø·ÃÎÊ
ÒѾÔÚMYSQLÀïgrantÁËȨÏÞÁË¡£ÔÚÍâÍø»¹ÊDz»ÄÜ·ÃÎÊ .
ÎÊÌ⣺
cat /etc/mysql/my.conf
ÕÒµ½ÏÂÃæÒ»ÐÐ
bind-address = 127.0.0.1
Î ......
³£ÓÃmysqlÃüÁîÐÐÃüÁî
¡¡¡¡1 .mysqlµÄÆô¶¯ÓëÍ£Ö¹
¡¡¡¡Æô¶¯MYSQL·þÎñ net start mysql
¡¡¡¡Í£Ö¹MYSQL·þÎñ net stop mysql
¡¡¡¡2 . netstat –na | findstr 3306 ²é¿´±»¼àÌýµÄ¶Ë¿Ú , findstrÓÃÓÚ²éÕÒºóÃæµÄ¶Ë¿ÚÊÇ·ñ´æÔÚ
¡¡¡¡3 . ÔÚÃüÁîÐÐÖеǽMYSQL¿ØÖÆ̨ , ¼´Ê¹Óà MYSQL COMMEND LINE TOOL
¡¡¡¡ Óï·¨¸ñʽ ......
·ÖÒ³¹¦ÄÜÔÚÈκÎÓ¦ÓÃÖж¼±È½Ï³£¼û£¬¶ø
Mysql
µÄ´æ´¢¹ý³Ì·ÖÒ³±ØÐëͨ¹ý¶¯Ì¬
sql
À´Ö´ÐС£·ÖÒ³¶ÔÓ¦µÄ
offset
ºÍ
row_count
±ØÐëÏÈÓÃ
concat
º¯Êý±ä³É×Ö·û´®×é×°µ½
sql
ÖУ¨ÈçÓï¾ä
1
£©£¬¶ø²»ÄÜÖ±½ÓʹÓã¨ÈçÓï¾ä
2
£¬
Mysql
²»Ö§³Ö£©¡£
Mysql
·ÖÒ³¹¦ÄܵÄʵÏÖÈçÏ´úÂëËùʾ£º
&nbs ......
Ïë²âÊÔϱí·ÖÇø¹¦Äܸú×ÔÖ÷µÄ·Ö²¼Ê½µÄÐÔÄܲîÒ죬½øÐÐÁ˼òµ¥µÄ²âÊÔ£¬Ç°ºó»¨·ÑÁË°ë¸öСʱ£¬¿ÉÄܲâÊÔÊý¾Ý²»Ì«×¼È·¡£
¡¾²âÊÔ»·¾³¡¿
²Ù×÷ϵͳ£ºWindows XP SP2
MySQL£º 5.1.19-beta-community-nt-debug
¡¾²âÊÔ¹ý³Ì¡¿
²é¿´MySQL°æ±¾£º
mysql> select version();
+--------------------------------+
| version() ......
ÔÚ
oracle
ÖУ¬
sequence
Ìṩ¶à±í¶à×ֶοɹ²ÓÃÒ»¸ö²»Öظ´Öµ¡£
Mysql
ÖдæÔÚ×ÔÔöÁУ¬»ù±¾¿ÉÒÔÂú×ã
PK
µÄÒªÇó¡£µ«×ÔÔöÁдæÔÚÏÞÖÆ£º
a.
Ö»ÄÜÓÃÓÚ±íÖеÄÒ»¸ö×ֶΣ¬Ò»ÕŲ»ÄÜͬʱ´æÔÚÁ½¸öÒÔÉϵÄ×ÔÔöÁÐ
;
b.
×ÔÔöÁбØÐë±»¶¨ÒåΪ
key
£¨
PK
»ò
FK
£©
;
c.
×ÔÔöÁв»Äܱ»¶à¸ö±í¹²ÓÃ
;
d.
µ±
insert
Óï¾ä² ......