Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am writing an application wherein I want to detect whether MySQL server is running as Amazon RDS instance? Can somebody help me out how to detect it?

auto_increment_increment1
auto_increment_offset1
autocommitON
automatic_sp_privilegesON
back_log50
basedir/rdsdbbin/mysql-5.1.45.R1/
big_tablesOFF
binlog_cache_size32768
binlog_direct_non_transactional_updatesOFF
binlog_formatMIXED
bulk_insert_buffer_size8388608
character_set_clientutf8
character_set_connectionutf8
character_set_databaselatin1
character_set_filesystembinary
character_set_resultsutf8
character_set_serverlatin1
character_set_systemutf8
character_sets_dir/rdsdbbin/mysql-5.1.45.R1/share/mysql/charsets/
collation_connectionutf8_general_ci
collation_databaselatin1_swedish_ci
collation_serverlatin1_swedish_ci
completion_type0
concurrent_insert1
connect_timeout10
datadir/rdsdbdata/db/
date_format%Y-%m-%d
datetime_format%Y-%m-%d%H:%i:%s
default_week_format0
delay_key_writeON
delayed_insert_limit100
delayed_insert_timeout300
delayed_queue_size1000
div_precision_increment4
engine_condition_pushdownON
error_count0
event_schedulerOFF
expire_logs_days0
flushOFF
flush_time0
foreign_key_checksON
ft_boolean_syntax+-><()~*:""&|
ft_max_word_len84
ft_min_word_len4
ft_query_expansion_limit20
ft_stopword_file(built-in)
general_logOFF
general_log_file/rdsdbdata/log/mysql-3306.log
group_concat_max_len1024
have_community_featuresYES
have_compressYES
have_cryptYES
have_csvYES
have_dynamic_loadingYES
have_geometryYES
have_innodbYES
have_ndbclusterNO
have_opensslYES
have_partitioningYES
have_query_cacheYES
have_rtree_keysYES
have_sslYES
have_symlinkYES
hostnameip-10-28-182-30
identity0
ignore_builtin_innodbOFF
init_connect
init_file
init_slave
innodb_adaptive_hash_indexON
innodb_additional_mem_pool_size2097152
innodb_autoextend_increment8
innodb_autoinc_lock_mode1
innodb_buffer_pool_size1179648000
innodb_checksumsON
innodb_commit_concurrency0
innodb_concurrency_tickets500
innodb_data_file_pathibdata1:10M:autoextend
share|improve this question
    
@RolandoMySQLDBA and @Aaron I think only way to detect is to check RDS endpoint name rds.amazonaws.com –  Mahesh Patil Jun 1 '12 at 13:08
add comment

2 Answers

DISCLAIMER : Never used Amazon RDS

Since SELECT VERSION(); does not work, here is a suggestion:

Run SHOW GLOBAL VARIABLES; on a standard installation of MySQL and compare it with SHOW GLOBAL VARIABLES; on a Amazon RDS installation of MySQL.

It is possible that there may be AmazonRDS-specific variables in place.

Try running SHOW GLOBAL VARIABLES LIKE '%rds%'; and see if there are any variables. If you find any such variables, then that is your query to run.

share|improve this answer
    
a) only difference is in /datadir/ path and nothing else between Amazon RDS and standard MySQL installation b) also show variables like '%rds%' returns just old_passrwords variable name :-( I have asked to Amazon RDS forums as well lets see what reply I get from them. –  Mahesh Patil May 30 '12 at 14:19
    
Please run SHOW VARIABLES; on the RDS instance and post all the variables. –  RolandoMySQLDBA May 30 '12 at 14:23
    
I can't post all variables here space limitation :-( –  Mahesh Patil May 30 '12 at 14:34
    
Please post it in the question body –  RolandoMySQLDBA May 30 '12 at 15:02
    
Please post all the variables in the question body –  RolandoMySQLDBA Jun 3 '12 at 0:05
show 1 more comment

Try

SELECT @@version;

I believe that Amazon has their own build of MySQL and would be apparent there.

EDIT 2012-05-30

@@version does not return a unique string, but it appears that all RDS instances have the same basedir/datadir/tmpdir, etc, so you could look at @@basedir and see if it matches /rdsdbbin/mysql/:

mysql> select @@basedir;
+------------------+
| @@basedir        |
+------------------+
| /rdsdbbin/mysql/ |
+------------------+
1 row in set (0.00 sec)

This is not 100% definitive, but chances are pretty high that if the basedir is set to something like rdsdbbin, then it's an RDS instance.

share|improve this answer
    
or SELECT VERSION(); as well. +1 !!! –  RolandoMySQLDBA May 30 '12 at 13:53
    
@Aaron Brown select version(); does not help either it's same as normal MySQL server unlike percona,MariaDB patches :-( –  Mahesh Patil May 30 '12 at 13:53
    
@RolandoMySQLDBA Select @@version OR Select version(); does not help as it is same as normal MySQL instance. –  Mahesh Patil May 30 '12 at 13:58
    
I added to my answer. –  Aaron Brown May 30 '12 at 14:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.