Sunday, May 25, 2008

J2EE vs Ruby

Rails and a typical J2EE Web stack

The Rails stack to a typical J2EE Web stack comprised of the Tomcat servlet container, the Struts Web application framework, and the Hibernate persistence framework.



Comparison of Rails and J2EE stacks

As you can see, the fundamental difference between the Rails stack and the components that make up a common J2EE-based Web application is small. Both have a container in which the application code will execute; an MVC framework that helps to separate the application's model, view, and control; and a mechanism to persist data.Reference

Wednesday, May 7, 2008

Mysql create user, database & access

I broken my head to create user and give access permission to the particular database.

Finally i got the problem that "Version problem".

I am using "mysql Ver 14.7 Distrib 4.1.20, for redhat-linux-gnu (i686)"

If you face this problem then, this post will help you reduce your time.

Commands:
1) CREATE DATABASE {DATABASE NAME};
2) GRANT ALL PRIVILEGES ON {DATABASE_NAME}.* TO '{USER NAME}'@'host' IDENTIFIED BY 'password';
3) use mysql;
4) update user set select_priv = 'Y',update_priv = 'Y',create_priv = 'Y', delete_priv = 'Y' where user = 'USER_NAME';



Explanation:
1) CREATE DATABASE ;
Create database.
2) GRANT ALL PRIVILEGES ON DATABASE_NAME.* TO ''@'host' IDENTIFIED BY 'password';
We haven't created user but granting permission to the user. This will create a user with name {USER_NAME} in the "user" table of "mysql" database.
3) use mysql;
Login to mysql table to update the table level permission.
4) update user set select_priv = 'Y',update_priv = 'Y',create_priv = 'Y', delete_priv = 'Y' where user = 'USER_NAME';
This will update the basic manipulation permission to the user.