Administering OpenSolaris Based MySQL AMI using MySQL Administator Tool


before you begin, have a quick look at the opensolaris MYSQL AMI(Amazon Machine Images) catalog

[Step -1]

Launch OpenSolaris MySQL 5 AMI

-bash # ec2-run-instances ami-63ce2a0a -k your-keypair

[Step -2]

get the public DNS name associated with the instance

-bash # ec2-describe-instances i-xxxxxxxx

[Step -3]

if the instance is in the creation or booting up phase, you may see
‘Pending’ in place of address.

Once the instance is up and running you will get the public DNS name
which should look like as ec2-xx-xxx-xx-xx.compute-1.amazonaws.com

[Step -4]

login into the instancce with the your keypair

ssh -i <your keypair file path>
root@ec2-xx-xxx-xx-xx.compute-1.amazonaws.com

[Step -5]

The first step to start MySQL server.

To do this, “su – mysql” and type “mysqld &” and “exit”

-bash # su – mysql
mysqld &

[Step-6]

if you have changed the original my.conf file (/etc/my.cnf) make sure
that there is no “skip-networking” option in this file.

[Step-7]

test if mysql is listening to external connections on the port 3306

-bash # netstat -a | grep -i 3306

*.3306
*.*
0      0
49152      0 LISTEN

[Step-8]

Login into mysql database with root user

-bash # su – mysql
-bash # mysql -u root -p

[Step-9]

Execute this query to grant access to external remote host for
administering mysql databases.

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP,
INDEX,ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO ‘root’@’%’
IDENTIFIED BY ‘password’;

Query OK, 0 rows affected (0.00 sec)

here  ‘%; is the wild card character and used for any remote
host. (if you want to give access to specific remote host, we can
replace it with host address) and ‘password’ is the password you want
to set for the remote host which needs to be provided to make
connection.

[Step-10]

Open “MySQL Administrator” tool.

Provide follwing details to connect to the instance

Server Hostname: ec2-xx-xxx-xx-xx.compute-1.amazonaws.com

Username: root

password: password

click on the connect and you are ready to administer mysql server
running on ec2 instance  with mysql administrator tool.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s