Friday Oct 17, 2008

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

mysql_admin_tool_ec2-mysql_ami_snap1

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

mysql_admin_tool_ec2-mysql_ami_snap2


About

Divyen Patel

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today