MySql³£ÓÃÃüÁî
Æô¶¯£ºnet start mySql;
½øÈ룺mysql -u root -p/mysql -h localhost -u root -p databaseName;
ÁгöÊý¾Ý¿â£ºshow databases;
Ñ¡ÔñÊý¾Ý¿â£ºuse databaseName;
Áгö±í¸ñ£ºshow tables£»
ÏÔʾ±í¸ñÁеÄÊôÐÔ£ºshow columns from tableName£»
½¨Á¢Êý¾Ý¿â£ºsource fileName.txt;
Æ¥Åä×Ö·û£º¿ÉÒÔÓÃͨÅä·û_´ú±íÈκÎÒ»¸ö×Ö·û£¬£¥´ú±íÈκÎ×Ö·û´®;
Ôö¼ÓÒ»¸ö×ֶΣºalter table tabelName add column fieldName dateType;
Ôö¼Ó¶à¸ö×ֶΣºalter table tabelName add column fieldName1 dateType,add columns fieldName2 dateType;
¶àÐÐÃüÁîÊäÈë:×¢Òâ²»Äܽ«µ¥´Ê¶Ï¿ª;µ±²åÈë»ò¸ü¸ÄÊý¾Ýʱ£¬²»Äܽ«×ֶεÄ×Ö·û´®Õ¹¿ªµ½¶àÐÐÀ·ñÔòÓ²»Ø³µ½«±»´¢´æµ½Êý¾ÝÖÐ;
Ôö¼ÓÒ»¸ö¹ÜÀíÔ±ÕÊ»§£ºgrant all on *.* to user@localhost identified by "password";
ÿÌõÓï¾äÊäÈëÍê±ÏºóÒªÔÚĩβÌî¼Ó·ÖºÅ';'£¬»òÕßÌî¼Ó'\g'Ò²¿ÉÒÔ£»
²éѯʱ¼ä£ºselect now();
²éѯµ±Ç°Óû§£ºselect user();
²éѯÊý¾Ý¿â°æ±¾£ºselect version();
²éѯµ±Ç°Ê¹ÓõÄÊý¾Ý¿â£ºselect database();
1¡¢É¾³ýstudent_courseÊý¾Ý¿âÖеÄstudentsÊý¾Ý±í£º
rm -f student_course/students.*
2¡¢±¸·ÝÊý¾Ý¿â£º(½«Êý¾Ý¿âtest±¸·Ý)
mysqldump -u root -p test>c:\test.txt
±¸·Ý±í¸ñ£º(±¸·ÝtestÊý¾Ý¿âϵÄmytable±í¸ñ)
mysqldump -u root -p test mytable>c:\test.txt
½«±¸·ÝÊý¾Ýµ¼Èëµ½Êý¾Ý¿â£º(µ¼»ØtestÊý¾Ý¿â)
mysql -u root -p test
3¡¢´´½¨ÁÙʱ±í£º(½¨Á¢ÁÙʱ±ízengchao)
create temporary table zengchao(name varchar(10));
4¡¢´´½¨±íÊÇÏÈÅжϱíÊÇ·ñ´æÔÚ
create table if not exists students(……);
5¡¢´ÓÒѾÓеıíÖи´ÖƱíµÄ½á¹¹
create table table2 select * from table1 where 1<>1;
6¡¢¸´ÖƱí
create table table2 select * from table1;
7¡¢¶Ô±íÖØÐÂÃüÃû
alter table table1 rename as table2;
8¡¢ÐÞ¸ÄÁеÄÀàÐÍ
alter table table1 modify id int unsigned;//ÐÞ¸ÄÁÐidµÄÀàÐÍΪint unsigned
alt
Ïà¹ØÎĵµ£º
integer »òÕß int
int »òÕß java.lang.Integer
INTEGER
4 ×Ö½Ú
long
long Long
BIGINT
8 ×Ö½Ú
short
short Short
SMALLINT
2 ×Ö½Ú
byte
byte Byte
TINYINT
1 ×Ö½Ú
float
float Float
FLOAT
4 ×Ö½Ú
double
double Double
DOUBLE
8 ×Ö½Ú
b ......
MySQLÖÐʹÓô洢¹ý³Ì
ʹÓÃCallableStatementsÖ´Ðд洢¹ý³Ì
mysql°æ±¾:5.0
Connector/JµÄ°æ±¾:3.1.1ÒÔÉÏ(java.sql.CallableStatement½Ó¿ÚÒÑÍêȫʵÏÖ,³ýÁËgetParameterMetaData()·½·¨)
MySQLµÄ´æ´¢¹ý³ÌÓï·¨ÔÚMySQL²Î¿¼ÊÖ²áµÄ"´æ´¢¹ý³ÌºÍº¯Êý"Ò»ÕÂ.
http://www.mysql.com/doc/en/Stored_Procedures.html
ÏÂÃæÊÇÒ»¸ ......
À´Ô´£ºhttp://www.sudone.com/linux/mysql_debug.html
×÷ÕߣºAyou
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓ ......
ÐÞ¸Älinux·þÎñÆ÷µÄhttpÅäÖÃÖ®ºó£¬±ØÐëÖØÆôApache·þÎñ£¬ÃüÁîΪ£º /etc/rc.d/init.d/httpd restart
chown -R mysql:mysql Ŀ¼Ãû ¸Ä±äÎļþÊôÐÔ
mysqladmin -u root -p password 'new password' ÉèÖÃÃÜÂë
apt-get remove ɾ³ýÈí¼þ
apt-get clean ÇåÀí
/etc/rc.d/init.d/mysqld restart
php ¾ÍÅäÖÃÁËsession Ö÷ ......