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
Ïà¹ØÎĵµ£º
ÏÂÎç¿´ÁËÒ»¶ÎPHP100µÄÊÓÆµ¡£
Ò²ËãÓеãÊÕ»ñ¡£
ÀïÃæµÄÒ»¶Î×ÔдµÄfindallµÄSQLº¯Êý£º
public function findall($table) {
$this->query("SELECT * from $table");
}
ÔÀ´Ö»ÊÇÕâô¼òµ¥£¬¸Õ»¹ÔÚ˼¿¼¡£
ʹÓÃÁËTAB¼üÉÏÃæµÄ¶ÙºÅÀ´ÐÞÊÎMYSQLÀïµÄ×Ö¶ÎÃû£¬È磺
UPDATE tablename SET `fieldname`='values' wh ......
À´Ô´£ºhttp://www.sudone.com/linux/mysql_debug.html
×÷ÕߣºAyou
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓ ......
Á¬½Ó´úÂë1Ö±½ÓÊäÈë
<%
Dim my_conn, sql,rs
Set my_conn = createobject("ADODB.Connection")
my_conn.open = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=localhost;"_ '·þÎñÆ÷Ãû
& "DATABASE=mybase;"_ 'Êý¾Ý¿âÃû
& "UID=root;PWD=111; OPTION=35;" 'Óû§ÃûºÍÃÜÂë
Set rs = Server.Crea ......
ÊÖ¶¯½¨±í£º
CREATE TABLE `excel` (
`id` int(11) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`passwd` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gb2312; ×¢ÒâÊÇgb2312
È»ºóÔÚÁ¬½ÓÊý¾Ý¿âʱ¼ÓÉÏ:
useUnicode=true&characterEncoding=gb2312.
¾ÍokÀ²£¡ ......
1¡¢mysqlÊý¾Ý¿âÓÐÁ½ÖÖÇý¶¯£º
MySQL Connector/J Driver¡¢MMMysql driver¡£
2¡¢µ¼Èëµ¼³öÊý¾Ý¿âÃüÁ£¨binĿ¼Ï£©
µ¼³ö£ºmysqldump -u root -p bokele >c:/mysql.sql --default-character-set=gbk
µ¼È룺C:\mysql\bin\> mysql -u root -p
˵Ã÷£ºC:\mysql\bin\±íʾ½øÈëmysql³ÌÐò ......