linuxÏ mysqlÓû§µÄ¹ÜÀí
linux
ÏÂ mysql
Óû§µÄ¹ÜÀí
ÎÄÕ·ÖÀà:Êý¾Ý¿â
¹Ø¼ü×Ö: linux
mysql
Óû§¹ÜÀí
×Ô´ÓÉÏÔÚredhat Enterprise 5 Öа²×°ÁËMySQL
,Õâ´ÎÀ´Êµ¼ù²Ù×÷Ò»ÏÂMySQL
Óû§µÄ¹ÜÀí£»
Ò»¡¢rootÓû§ÃÜÂëµÄά»¤£º
ÓÉÓÚ°²×°MySQL
Íêºó,MySQL
»á×Ô¶¯Ìṩһ¸ö²»´øÃÜÂëµÄrootÓû§£¬ÎªÁË°²È«Æð¼û¸ørootÉèÖÃÃÜÂ룺
#mysqladmin -u root password 123
(123ΪÃÜÂ룬Ҳ¿ÉÒÔд³É:'123'»ò"123") £»
ÉèÖÃÃÜÂëºóµÇÈëʱ¾Í²»ÄÜÖ±½ÓÊäÈëmysql
ÁË£¬±ØÐë¸úЩ²ÎÊýÁË,ÈçÏ£º
[root@localhost ~]# mysql
-u root -p
£¨-u ºó¸úµÇÈëµÄÓû§Ãû£¬-p ÌáʾҪÃÜÂëµÇÈ룩
Enter password:(ÊäÈëÃÜÂë)
ÐÞ¸ÄÃÜÂ룺
[root@localhost ~] #mysqladmin -u root -p password 123456
(password ºó¸úµÄÊÇÒª¸üеÄÐÂÃÜÂë)
Enter password:(ÊäÈëÔʼÃÜÂ룬»Ø³µ¼´¿É)
¶þ¡¢ÆäËûÓû§µÄÔö¼ÓºÍɾ³ý£º
ÒÔrootÓû§µÇÈ룬ÔÚmysql
ÖÐÓÐÒ»ÕÅmysql
.user±íÊÇ´æ´¢MySQL
ÖÐËùÓÐÓû§µÄÐÅÏ¢±í£¬ËùÒÔ¿ÉÒÔÖ±½ÓÔö¼Óɾ³ýÕâ¸ö±íµÄ¼Ç¼¾Í¿ÉÔö¼ÓºÍɾ³ýÓû§£»
1.Ìí¼ÓÓû§£¨ÓÐÁ½ÖÖÐÎʽ£©£º
A.mysql
> grant all on *.* to yushan@"%" identified by "123" ;
mysql
>flush privileges;
(Ë¢ÐÂϵͳȨÏÞ±í)
(Ö´ÐÐÍê»áÔÚmysql
.user
±í²åÈëÒ»Ìõ¼Ç¼£¬all±íʾËùÓÐȨÏÞ(°üÀ¨Ôö ɾ ¸Ä ²éµÈȨÏÞ)£¬ *.*
±íʾËùÓÐÊý¾Ý¿â£¬yushanΪÌí¼ÓµÄÓû§Ãû£¬123ΪÃÜÂë,%ΪƥÅäµÄËùÓÐÖ÷»ú£¬ÉÏÃæµÄÐÅÏ¢¶¼¿ÉÒÔÖ¸¶¨Èçgrant select,update on
db.* to yushan@localhost identified by '123";)
B.Ö±½Ó¶Ômysql
.userÌí¼ÓÒ»Ìõ¼Ç¼
mysql
> insert into mysql
.user(Host,User,Password) values("localhost","yus
Ïà¹ØÎĵµ£º
ÔÌû£ºhttp://www.sudu.cn/info/html/edu/20070101/286290.html
¼ò¶øÑÔÖ®,²úÉú¶Î´íÎó¾ÍÊÇ·ÃÎÊÁË´íÎóµÄÄÚ´æ¶Î£¬Ò»°ãÊÇÄãûÓÐȨÏÞ£¬»ò¸ù±¾¾Í²»´æÔÚ¶ÔÓ¦µÄÎïÀíÄÚ´æ,ÓÈÆä³£¼ûµÄÊÇ·ÃÎÊ0µØÖ·.
Ò»
°ãÀ´Ëµ,¶Î´íÎó¾ÍÊÇÖ¸·ÃÎʵÄÄڴ泬³öÁËϵͳËù¸øÕâ¸ö³ÌʽµÄÄÚ´æ¿Õ¼ä£¬Í¨³£Õâ¸öÖµÊÇÓÉgdtrÀ´±£´æµÄ£¬ËûÊǸö48λµÄ¼Ä´æÆ ......
Ò» ÏÂÔØMySQL
http://dev.mysql.com/downloads/mysql/5.0.html
½âѹMySQL£¨F:\Program Files\MySQL\£©MySQL°²×°Ä¿Â¼
¶þ н¨my.ini
ÔÚF:\Program Files\MySQL\Ͻ¨Á¢my.iniÎļþ£¬ÄÚÈÝΪ
my.ini
[mysqld]
# ÉèÖÃmysqlµÄ°²×°Ä¿Â¼
basedir=F:\\Program Files\\MySQL
# ÉèÖÃmysqlÊý¾Ý¿âµÄÊý¾ÝµÄ´æ·ÅĿ¼£¬±ØÐ ......
mysql ¿ÉÒÔͨ¹ý×Ó²éѯµÃµ½ÒªÉ¾³ýµÄ¼Ç¼Ìõ¼þ£¬È»ºóͨ¹ý×Ó²éѯµÃ½á¹ûÆ¥ÅäҪɾ³ýµÄ¼Ç¼¡£µ«ÊÇ mysql ²»ÄÜÖ±½Óɾ³ý×Ó²éѯ±íÖеÄÊý¾Ý£¬±ØÐëͨ¹ýÒ»¸öÁÙʱ±íÀ´½â¾ö¡£ÀýÈ磺
delete from t_transaction where exists
(select d.* from t_ti_category a,t_category b,t_ ......
ÀûÓÃ
ÏÂÔصÄÕâ¶Î´úÂ룬³É¹¦ÊµÏÖÁËÊØ»¤½ø³Ì£¬ÔÀ´ÊØ»¤½ø³ÌÊǺܼòµ¥µÄÊÂÇé¡£
¡¡¡¡ÔÚmainº¯ÊýÖÐÖ´ÐÐ
¡¡¡¡init_daemon();//³õʼ»¯ÎªDaemon
¡¡¡¡¾Í¿ÉÒ԰ѽø³Ì±ä³ÉÊØ»¤½ø³Ì
¡¡¡¡
#include
#include
#include
#include
#include
void
init_daemon(void
)
{
int
pid;
int
i;
if
(pid=fork()) ......