Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql »ù±¾ÃüÁî

µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö²ÎÊý-h»úÆ÷IP
µÚÈýÕС¢Ôö¼ÓÐÂÓû§
¸ñʽ£ºgrant ȨÏÞ on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë"
È磬Ôö¼ÓÒ»¸öÓû§user1ÃÜÂëΪpassword1£¬ÈÃÆä¿ÉÒÔÔÚ±¾»úÉϵǼ£¬ ²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬Èëmysql£¬È»ºó¼üÈëÒÔÏÂÃüÁ
grant select,insert,update,delete on *.* to user1@localhost Identified by "password1";
Èç¹ûÏ£Íû¸ÃÓû§Äܹ»ÔÚÈκλúÆ÷Éϵǽmysql£¬Ôò½«localhost¸ÄΪ"%"¡£
Èç¹ûÄã²»Ïëuser1ÓÐÃÜÂ룬¿ÉÒÔÔÙ´òÒ»¸öÃüÁÃÜÂëÈ¥µô¡£
grant select,insert,update,delete on mydb.* to user1@localhost identified by "";
µÚËÄÕУº ²Ù×÷Êý¾Ý¿â
µÇ¼µ½mysqlÖУ¬È»ºóÔÚmysqlµÄÌáʾ·ûÏÂÔËÐÐÏÂÁÐÃüÁÿ¸öÃüÁîÒԷֺŽáÊø¡£
1¡¢ ÏÔʾÊý¾Ý¿âÁÐ±í¡£
show databases;
ȱʡÓÐÁ½¸öÊý¾Ý¿â£ºmysqlºÍtest¡£ mysql¿â´æ·Å×ÅmysqlµÄϵͳºÍÓû§È¨ÏÞÐÅÏ¢£¬ÎÒÃǸÄÃÜÂëºÍÐÂÔöÓû§£¬Êµ¼ÊÉϾÍÊǶÔÕâ¸ö¿â½øÐвÙ×÷¡£
2¡¢ ÏÔʾ¿âÖеÄÊý¾Ý±í£º
use mysql;
show tables;
3¡¢ ÏÔʾÊý¾Ý±íµÄ½á¹¹£º
describe ±íÃû;
4¡¢ ½¨¿âÓëɾ¿â£º
create database ¿âÃû;
drop database ¿âÃû;
5¡¢ ½¨±í£º
use ¿âÃû;
create table ±íÃû(×Ö¶ÎÁбí);
drop table ±íÃû;
6¡¢ Çå¿Õ±íÖмǼ£º
delete from ±íÃû;
7¡¢ ÏÔʾ±íÖеļǼ£º
select * from ±íÃû;
µÚÎåÕС¢µ¼³öºÍµ¼ÈëÊý¾Ý
1. µ¼³öÊý¾Ý£º
mysqldump --opt test > mysql.test
¼´½«Êý¾Ý¿âtestÊý¾Ý¿âµ¼³öµ½mysql.testÎļþ£¬ºóÕßÊÇÒ»¸öÎı¾Îļþ
È磺mysqldump -u root -p123456 --databases dbname > mysql.dbname
¾ÍÊÇ°ÑÊý¾Ý¿âdbnameµ¼³öµ½Îļþmysql.dbnameÖС£
2. µ¼ÈëÊý¾Ý:
mysqlimport -u root -p123456 < mysql.dbname¡£
²»ÓýâÊÍÁË°É¡£
3. ½«Îı¾Êý¾Ýµ¼ÈëÊý¾Ý¿â:
Îı¾Êý¾ÝµÄ×Ö¶ÎÊý¾ÝÖ®¼äÓÃtab¼ü¸ô¿ª¡£
use test;
load data local infile "ÎļþÃû" into table ±íÃû;
1:ʹÓÃSHOWÓï¾äÕÒ³öÔÚ·þÎñÆ÷Éϵ±Ç°´æÔÚʲôÊý¾Ý¿â£º
mysql> SHOW DATABASES;
2:2¡¢´´½¨Ò»¸öÊý¾Ý¿âMYSQLDATA
mysql> CREATE DATABASE MYSQLDATA;
3:Ñ¡Ô


Ïà¹ØÎĵµ£º

mysql È¡³öµ±Ç°¼Ç¼µÄÉÏÒ»Ìõ¼Ç¼ºÍÏÂÒ»Ìõ¼Ç¼

ÒÑÖªµ±Ç°¼Ç¼idΪ$id,È¡³öµ±Ç°¼Ç¼µÄÉÏÒ»Ìõ¼Ç¼ºÍÏÂÒ»Ìõ¼Ç¼µÄid,title×ֶΡ£±íÃûnews¡£
$sql = "SELECT CASE WHEN SIGN(id - $id) > 0 THEN MIN(id) WHEN SIGN(id - $id) < 0 THEN MAX(id) END AS id,title from news WHERE id <> $id GROUP BY SIGN(id - $id) ORDER BY SIGN(id - $id)"; ......

ʵÀý½²½âÈçºÎʹÓÃC++²Ù×÷MySQLÊý¾Ý¿âÀà

 
¡¡¡¡ÓÃC++²Ù×÷MySQLÊý¾Ý¿âÀࣺ
¡¡¡¡×¢ÊÍ£ºÕ⼸¸öÀà¶Ô´¦Àí²»ÊǺܴóÊý¾ÝÁ¿µÄ²Ù×÷ÊǺÜÀíÏëµÄ£¬ µ«²»ÊÊÒËÌØ´óÐ͵ÄÊý¾ÝµÄ²éѯ£¬ÒòΪԴÂëÖн«²éѯµ½µÄÊý¾ÝÖ±½Ó·ÅÈëÁËÄÚ´æ¡£
¡¡¡¡/*
¡¡¡¡* project:
¡¡¡¡* ͨÓÃÄ£¿é ( Óà c++ ´¦Àí mysql Êý¾Ý¿âÀ࣬ÏñADO )
¡¡¡¡*
¡¡¡¡* description:
¡¡¡¡*
¡¡¡¡* ͨ¹ýDataBase,Reco ......

MySQLº¯Êý´óÈ«

MySQL±ØҪʱ×Ô¶¯±ä»»Êý×ÖΪ×Ö·û´®£¬²¢ÇÒ·´¹ýÀ´Ò²Èç´Ë£º
mysql> SELECT 1+"1";
        -> 2
mysql> SELECT CONCAT(2,' test');
        -> '2 test'
Èç¹ûÄãÏëÒªÃ÷È·µØ±ä»»Ò»¸öÊý×Öµ½Ò»¸ö×Ö·û´®£¬°ÑËü×÷Ϊ²ÎÊý´«µÝµ½CONCAT()¡£
Èç¹û×Ö·û´® ......

mysql×Ö·ûÂÒÂ룿£¿£¿£¿£¿£¿£¿£¿£¿£¿£¿£¿

I promise this is gonna be the last time on it :-)
×Ô從寫ÍêÏÂÃæ兩ƪÎÄÕ£º
wordpress 1.5Éý級×¢ÒâÊÂ項 - ÖÐÎÄ亂碼ƪ
mysql 4.1ÖÐÎÄ亂碼µÚ¶þ擊
過È¥幾個Ô¾Ͳ»斷ÓÐ來ÐÅ詢問¸÷種 mysql ÖÐÎÄÏàÈݵÄ ......

PHP/MYSQLʵÏÖ°´×Öĸ¼ìË÷

·½·¨Ò»£º½¨Ò»¸öÆ´Òô±í t_cosler £¬´æ·Åÿ¸ö×Öĸ¿ªÍ·µÄµÚÒ»¸öºº×ֵıàºÅºÍ×îºóÒ»¸öºº×ֵıàºÅ¡£   
BatchFile code+------+--------+-------+  
| f_PY | cBegin | cEnd  |  
+------+--------+-------+  
| A    |  45217 | 45252 | & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ