MySQL Basic Knowledge
MySQL°æ±¾: Server version: 5.1.44 Source distribution
ÐÞ¸ÄrootÃÜÂë
Èç¹ûûÓÐÃÜÂëʹÓÃÏÂÃæµÄÃüÁî, ½«ÃÜÂëÉèΪ"123456"
$ mysqladmin -u root password 123456
Èç¹ûÓÐÃÜÂëʹÓÃÏÂÃæµÄÃüÁî, ½«ÃÜÂë¸ÄΪ"123456"
$ mysqladmin -u root -p password 123456
Enter password:
Óû§ÕË»§¹ÜÀí
Ìí¼ÓÕË»§:
http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#user-account-management
Ìáµ½µÄ·½·¨²»ÊÊÓÃ:
mysql>
GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
¸ù¾Ýhttp://dev.mysql.com/doc/refman/5.1/en/adding-users.htmlËù˵, ÒªÏÈcreate user, È»ºóÔÙʹÓÃgrant, ¸ù¾Ý³¢ÊÔ, ÔÚmysqlÖÐ, Óï¾ä²»Çø·Ö´óСд. ÕýÈ·µÄ·½·¨ÈçÏÂ:
mysql> create user 'frank'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'frank'@'localhost' INDENTIFIED BY '123456' WITH GRANT OPTION;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED BY '123456' WITH GRANT OPTION' at line 1
mysql> GRANT ALL PRIVILEGES ON *.* TO 'frank'@'localhost' WITH GRANT OPTION;Query OK, 0 rows affected (0.00 sec)
mysql>
ÒÔÉÏÓï¾ä´´½¨ÁËÃûΪ"frank"µÄÓû§, ÃÜÂëΪ"123456", ¸ÃÓû§Îª³¬¼¶Óû§, Ö»ÄÜ´Ólocal hostµÇ¼.
mysql> create user 'frank'@'%' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'frank'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql>
ÉÏÃæµÄÓï¾ä´´½¨ÁËÃûΪ"frank"µÄ³¬¼¶Óû§, ÃÜÂëΪ"123456", ¸ÃÓû§¿ÉÒÔ´ÓÈÎÒâÖ÷»úµÇ¼. ´´½¨localhostµÄ"frank"Óû§ÊDZØÐëµÄ:
It is necessary to have both accounts for
monty
to be able to connect from anywhere
as monty
. Without the
localhost
account, the anonymous-user
account for localhost
that is created by
mysql_install_db
would take precede
Ïà¹ØÎĵµ£º
×ÔÔö³¤ÀàÐÍÔö¼Ó
1.Èç¹ûdbmsÊÇMsSql,ÔòÑ¡¶¨±íºó£¬database-> edit current dbms-> ³öÏÖDBMS properties¶Ô»°¿ò£¬Ñ¡ÔñGeneralÒ³£¬×ó²àµÄÊ÷Ñ¡ÔñSQL 2000-> Profile-> Column-> Extended Attributes ÏÂÃæµÄExtIdentityIncrementÊDz½½ø ......
Ò» ÏÂÔØ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Êý¾Ý¿âµÄÊý¾ÝµÄ´æ·ÅĿ¼£¬±ØÐ ......
²é¿´Ä³¸ö±íµÄ½¨±íÓï¾ä £ºshow create table data_statdata;
drop index ts on data_statdata;
Ë÷ÒýÊǼÓËÙ²éѯµÄÖ÷ÒªÊֶΣ¬Ìرð¶ÔÓÚÉæ¼°¶à¸ö±íµÄ²éѯ¸üÊÇÈç´Ë¡£±¾½ÚÖУ¬½«½éÉÜË÷ÒýµÄ×÷Óá¢Ìص㣬ÒÔ¼°´´½¨ºÍɾ³ýË÷ÒýµÄÓï·¨¡£
13.4.1 ʹÓÃË÷ÒýÓÅ»¯²éѯ
Ë÷ÒýÊÇ¿ìËÙ¶¨Î»Êý¾ÝµÄ¼¼Êõ£¬Ê×ÏÈͨ¹ýÒ»¸öʾÀýÀ´Á˽ ......
¹Ø¼ü×Ö: mysql grant
±¾ÎÄʵÀý£¬ÔËÐÐÓÚ MySQL 5.0 ¼°ÒÔÉϰ汾¡£
MySQL ¸³ÓèÓû§È¨ÏÞÃüÁîµÄ¼òµ¥¸ñʽ¿É¸ÅÀ¨Îª£º
grant ȨÏÞ on Êý¾Ý¿â¶ÔÏó to Óû§
Ò»¡¢grant ÆÕͨÊý¾ÝÓû§£¬²éѯ¡¢²åÈë¡¢¸üС¢É¾³ý Êý¾Ý¿âÖÐËùÓбíÊý¾ÝµÄȨÀû¡£
grant select on testdb.* to common_user@'%'
grant insert on testdb.* to common_user ......
Ê×ÏȰ²×°phpMyadmin
[root@aladdin phpMyAdmin]# uname -a
Linux aladdin.leadtek.com.cn 2.6.32.11-99.fc12.i686.PAE #1 SMP Mon Apr 5 16:15:03 EDT 2010 i686 i686 i386 GNU/Linux
[root@aladdin phpMyAdmin]# yum info phpmyadmin
Loaded plugins: presto, refresh-packagekit
Installed Packages
Name &nbs ......