Mysql µ¼³ösqlÎļþ
Ò».MYSQLµÄÃüÁîÐÐģʽµÄÉèÖãº
×ÀÃæ->ÎҵĵçÄÔ->ÊôÐÔ->»·¾³±äÁ¿->н¨->
PATH=“£»path\mysql\bin;”ÆäÖÐpathΪMYSQLµÄ°²×°Â·¾¶¡£
¶þ.¼òµ¥µÄ½éÉÜÒ»ÏÂÃüÁîÐнøÈëMYSQLµÄ·½·¨£º
1.C:\>mysql -h hostname -u username -p
°´ENTER¼ü£¬µÈ´ýÈ»ºóÊäÈëÃÜÂë¡£ÕâÀïhostnameΪ·þÎñÆ÷µÄÃû³Æ£¬Èçlocalhost£¬usernameΪMYSQLµÄÓû§Ãû£¬Èçroot¡£
½øÈëÃüÁîÐкó¿ÉÒÔÖ±½Ó²Ù×÷MYSQLÁË¡£
2.¼òµ¥½éÉÜÒ»ÏÂMYSQLÃüÁ
mysql->CREATE DATABASE dbname;//´´½¨Êý¾Ý¿â
mysql->CREATE TABLE tablename;//´´½¨±í
mysql->SHOW DATABASES;//ÏÔʾÊý¾Ý¿âÐÅÏ¢£¬ÓÐÄÇЩ¿ÉÓõÄÊý¾Ý¿â¡£
mysql->USE dbname;//Ñ¡ÔñÊý¾Ý¿â
mysql->SHOW TABLES;//ÏÔʾ±íÐÅÏ¢£¬ÓÐÄÇЩ¿ÉÓõıí
mysql->DESCRIBE tablename;//ÏÔʾ´´½¨µÄ±íµÄÐÅÏ¢
Èý.´ÓÊý¾Ý¿âµ¼³öÊý¾Ý¿âÎļþ£º
1.½«Êý¾Ý¿âmydbµ¼³öµ½e:\mysql\mydb.sqlÎļþÖУº
´ò¿ª¿ªÊ¼->ÔËÐÐ->ÊäÈëcmd ½øÈëÃüÁîÐÐģʽ
c:\>mysqldump -h localhost -u root -p mydb >e:\mysql\mydb.sql
È»ºóÊäÈëÃÜÂ룬µÈ´ýÒ»»áµ¼³ö¾Í³É¹¦ÁË£¬¿ÉÒÔµ½Ä¿±êÎļþÖмì²éÊÇ·ñ³É¹¦¡£
2.½«Êý¾Ý¿âmydbÖеÄmytableµ¼³öµ½e:\mysql\mytable.sqlÎļþÖУº
c:\>mysqldump -h localhost -u root -p mydb mytable>e:\mysql\mytable.sql
3.½«Êý¾Ý¿âmydbµÄ½á¹¹µ¼³öµ½e:\mysql\mydb_stru.sqlÎļþÖУº
c:\>mysqldump -h localhost -u root -p mydb --add-drop-table >e:\mysql\mydb_stru.sql
ËÄ.´ÓÍⲿÎļþµ¼ÈëÊý¾Ýµ½Êý¾Ý¿âÖУº
´Óe:\mysql\mydb2.sqlÖн«ÎļþÖеÄSQLÓï¾äµ¼ÈëÊý¾Ý¿âÖУº
1.´ÓÃüÁîÐнøÈëmysql£¬È»ºóÓÃÃüÁîCREATE DATABASE mydb2;´´½¨Êý¾Ý¿âmydb2¡£
2.Í˳ömysql ¿ÉÒÔÊäÈëÃüÁîexit£»»òÕßquit£»
3.ÔÚCMDÖÐÊäÈëÏÂÁÐÃüÁ
c:\>mysql -h localhost -u root -p mydb2 < e:\mysql\mydb2.sql
È»ºóÊäÈëÃÜÂ룬¾ÍOKÁË¡£
Îå.ÏÂÃæ̸һϹØÓÚµ¼ÈëÎļþ´óСÏÞÖÆÎÊÌâµÄ½â¾ö£º
ĬÈÏÇé¿öÏ£ºmysql ¶Ôµ¼ÈëÎļþ´óСÓÐÏÞÖƵģ¬×î´óΪ2M£¬ËùÒÔµ±ÎļþºÜ´óʱºò£¬Ö±½ÓÎÞ·¨µ¼È룬ÏÂÃæ¾ÍÕâ¸öÎÊÌâµÄ½â¾öÁоÙÈçÏ£º
1.ÔÚphp.iniÖÐÐÞ¸ÄÏà¹Ø²ÎÊý£º
Ó°Ïìmysqlµ¼ÈëÎļþ´óСµÄ²ÎÊýÓÐÈý¸ö£º
memory_limit=128M,upload_max_filesize=2M,post_max_size=8M
ÐÞ¸Äupload_max_filesize=200 M Õ
Ïà¹ØÎĵµ£º
½ñÌìÔÚÉÏCSDN¿Õ¼äµÄʱºò£¬Êý¾Ý¿â³ö´íÖ±½ÓÅ׳öSQLÎÄÁË£¬ÏûÏ¢ÈçÏ£º
MySQL Error
Message
: MySQL Query Error
SQL
: SELECT main.*, field.* from uchome_space main, uchome_spacefield field
WHERE field.sex='1' AND field.uid=main.uid
ORDER BY main.viewnum DESC LIMIT 0,100
Error
: Inco ......
Ä¿Ç°LAMP (Linux + Apache + MySQL + PHP) ½ü¼¸ÄêÀ´·¢Õ¹Ñ¸ËÙ£¬ÒѾ³ÉΪWeb ·þÎñÆ÷µÄÊÂʵ±ê×¼¡£LAMP
Õâ¸ö´ÊµÄÓÉÀ´×îÔçʼÓڵ¹úÔÓÖ¾“c't Magazine”£¬Michael KunzeÔÚ1990Äê×îÏÈ°ÑÕâЩÏîÄ¿×éºÏÔÚÒ»Æð´´ÔìÁËLAMPµÄËõд×Ö¡£ÕâЩ×é¼þËäÈ»²¢²»ÊÇ¿ª¿ªÊ¼¾ÍÉè¼ÆΪһÆðʹÓõģ¬µ«ÊÇ£¬ÕâЩ¿ªÔ´Èí¼þ¶¼¿ÉÒԺܷ½±ã µÄË ......
¼¸¸öƽ³£ÓõÄmysqlº¯Êý
/*****************************************************
1.ÅжÏ×Ö·û´®ÊÇ·ñΪºº×Ö ·µ»ØÖµ£º1-ºº×Ö 0-·Çºº×Ö
*****************************************************/
DROP FUNCTION IF EXISTS fc_is_hanzi;
CREATE FUNCTION fc_is_hanzi(
p_str VARCHAR(1024)
)
......
MySQL±¸·Ý»¹ÔÊý¾Ý¿âÅú´¦Àí
ÔÚÈÕ³£¹¤×÷ÖУ¬ÎÒÃÇÍùÍùÐèÒª¶ÔMySQLÊý¾Ý¿â½øÐб¸·Ý£¬ÓÐʱ¿ÉÒÔͨ¹ý¿½±´Õû¸öÎļþ£¬ÓÐʱͨ¹ý±¸·ÝÕû¸ö¿â»¹ÓеÄʱºòÎÒÃǾÍÖ»ÐèÒª±¸·Ýij¸ö±í¡£
1¡¢±¸·ÝÊý¾Ý¿â(µ¥¸ö±í±¸·Ý) bk_table.bat
mysqldump -h127.0.0.1 -P3306 -uroot -proot --default-character-set=gbk -t database1 table1>tabl ......
Ò».Êý¾Ý¿ØÖÆÓï¾ä (DML) ²¿·Ö
1.Insert (ÍùÊý¾Ý±íÀï²åÈë¼Ç¼µÄÓï¾ä)
Insert INTO ±íÃû(×Ö¶ÎÃû1, ×Ö¶ÎÃû2, ……) VALUES ( Öµ1, Öµ2, ……);
&nb ......