MySQL grant Óï·¨µÄÏêϸ½âÎö
ÒÔϵÄÎÄÕÂÊÇMySQL grantÓï·¨µÄÏêϸ½âÎö£¬Èç¹ûÄã¶ÔMySQL grantÓï·¨µÄÏà¹ØµÄʵ¼Ê²Ù×÷ÓÐÐËȤµÄ»°£¬Äã¾Í¿ÉÒÔ¶ÔÒÔϵÄÎÄÕµã»÷¹Û¿´ÁË¡£ÎÒÃÇ´ó¼Ò¶¼ÖªµÀMySQLÊý¾Ý¿â¸³ÓèÓû§È¨ÏÞÃüÁîµÄ¼òµ¥¸ñʽ¿É¸ÅÀ¨Îª£º
grant ȨÏÞ on Êý¾Ý¿â¶ÔÏó to Óû§
Ò»¡¢grant ÆÕͨÊý¾ÝÓû§£¬²éѯ¡¢²åÈë¡¢¸üС¢É¾³ý Êý¾Ý¿âÖÐËùÓбíÊý¾ÝµÄȨÀû¡£
grant select on testdb.* to common_user@'%';
grant insert on testdb.* to common_user@'%';
grant update on testdb.* to common_user@'%';
grant delete on testdb.* to common_user@'%';
»òÕߣ¬ÓÃÒ»Ìõ MySQL ÃüÁîÀ´Ìæ´ú£º
grant select,insert,update,delete on testdb.* to common_user@'%'
¶þ¡¢grant Êý¾Ý¿â¿ª·¢ÈËÔ±£¬´´½¨±í¡¢Ë÷Òý¡¢ÊÓͼ¡¢´æ´¢¹ý³Ì¡¢º¯Êý¡£¡£¡£µÈȨÏÞ¡£
grant ´´½¨¡¢Ð޸ġ¢É¾³ý MySQL Êý¾Ý±í½á¹¹È¨ÏÞ¡£
grant create on testdb.* to developer@'192.168.0.%';
grant alter on testdb.* to developer@'192.168.0.%';
grant drop on testdb.* to developer@'192.168.0.%';
grant ²Ù×÷ MySQL Íâ¼üȨÏÞ¡£
grant references on testdb.* to developer@'192.168.0.%';
grant ²Ù×÷ MySQL ÁÙʱ±íȨÏÞ¡£
grant create temporary tables on testdb.* to
grant ²Ù×÷ MySQL Ë÷ÒýȨÏÞ¡£
grant index on testdb.* to
grant ²Ù×÷ MySQL ÊÓͼ¡¢²é¿´ÊÓͼԴ´úÂë ȨÏÞ¡£
grant create view on testdb.* to developer@'192.168.0.%';
grant show view on testdb.* to developer@'192.168.0.%';
grant ²Ù×÷ MySQL ´æ´¢¹ý³Ì¡¢º¯Êý ȨÏÞ¡£
grant create routine on testdb.* to developer@'192.168.0.%';
grant alter routine on testdb.* to developer@'192.168.0.%';
grant execute on testdb.* to developer@'192.168.0.%';
Èý¡¢grant ÆÕͨ DBA ¹ÜÀíij¸ö MySQL Êý¾Ý¿âµÄȨÏÞ¡£
grant all privileges on testdb to
ÆäÖУ¬¹Ø¼ü×Ö “privileges” ¿ÉÒÔÊ¡ÂÔ¡£
grant execute on procedure testdb.pr_add to 'dba'@'localhost';
grant execute on function testdb.fn_add to 'dba'@'localhost';
grant all on *.* to dba@'localhost'
Îå¡¢MySQL grant ȨÏÞ£¬·Ö±ð¿ÉÒÔ×÷ÓÃÔÚ¶à¸ö²ã´ÎÉÏ¡£
1. grant ×÷ÓÃÔÚÕû¸ö MySQL ·þÎñÆ÷ÉÏ£º
grant select on *.* to dba@localhost; -- dba ¿ÉÒÔ²éѯ MySQL ÖÐËùÓÐÊý¾Ý¿âÖÐµÄ±í¡£
grant all on *.* to dba@localhost; -- dba ¿ÉÒÔ¹ÜÀí MySQL ÖеÄËùÓÐÊ
Ïà¹ØÎĵµ£º
ÒÔÏÂΪOracleºÍMySQLÊý¾Ý¿âµÄһЩ¼òµ¥ÃüÁî¶Ô±È£¬¿´¿´ËüÃÇÖ®¼ä´æÔÚÄÄЩ²îÒì
¡¡¡¡SQL> select to_char(sysdate,'yyyy-mm-dd') from dual;
¡¡¡¡SQL> select to_char(sysdate,'hh24-mi-ss') from dual;
¡¡¡¡mysql> select date_format(now(),'%Y-%m-%d');
¡¡¡¡mysql> select time_format(now(),'%H-%i-%S');
¡¡¡¡ÈÕÆÚº ......
×î½üÔÚѧϰtomcat+mysql¿ª·¢web£¬ÔÚ°²×°ºÍжÔØmysqlµÄ¹ý³ÌÖÐÓöµ½ÁËһЩÎÊÌ⣬ÕÛÌÚÁËÎҺü¸Ìì¡£ÔÚÕâÀï¸ø´ó¼Ò½ÌÒ»ÏÂÍêÕûµÄжÔØmysqlµÄ¹ý³Ì¡£
ÓÐʱºò֮ǰ°²×°¹ýmysqlжÔغóÓÖÖØа²×°µÄ¹ý³ÌÖУ¬°²×°ºÃµÄmysql½ø²»È¥£¬ÈÃÈ˾õµÃºÜÐÄ·³£¬×Ô¼ºÒѾжÔØÁË£¬ÖØÐÂ×°Á˺óΪʲô½ø²»È¥ÄØ¡·£¿£¿ ÔÒòÊÇ ......
Ò» . °²×°ÓëÅäÖÃMYSQL
¶þ . ³£ÓÃmysqlÃüÁîÐÐÃüÁî
1 .mysqlµÄÆô¶¯ÓëÍ£Ö¹
Æô¶¯MYSQL·þÎñ net start mysql
Í£Ö¹MYSQL·þÎñ net stop mysql
2 . netstat –na | findstr 3306 ²é¿´±»¼àÌýµÄ¶Ë¿Ú , findstrÓÃÓÚ²éÕÒºóÃæµÄ¶Ë¿ÚÊÇ·ñ´æÔÚ
3 . ÔÚÃüÁîÐÐÖеǽMYSQL¿ØÖÆ̨ , ¼´Ê¹Óà MYSQL COMMEND LINE TOOL
......
Link from : http://www.5ilinux.com/blog/archives/000091.html
1.Ê×ÏÈÎÒÃǽ¨Á¢ÏàÓ¦µÄÓû§ºÍÓû§×é
groupadd -g 5500 ftpgroup
adduser -u 5500 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser
2.²Ù×÷Êý¾Ý¿â
mysql mysql -uroot -ppassword
create database ftpdb
grant select, upd ......
/*ÑÝʾһ¸öJDBC³ÌÐò£¬´ÓMysqlµÄLMDÊý¾Ý¿âÖжÁ³ö±íadminµÄÒ»¸öÐÅÏ¢*/
import java.sql.*;
public class TestMysqlConnection {
public static void main(String[] args) {
Connection conn = null;
Statement stmt = ......