Showing posts with label DataBase. Show all posts
Showing posts with label DataBase. Show all posts

Friday 9 October 2015

Create a new user in MYSQL and provide PRIVILEGES to new user




1. Install mysql in ubuntu using below command:

sudo apt-get install mysql-server mysql-client

2. Connect to mysql using below command:
mysql -u root -p

provide mysql password given as part of installation step1


3. Create a new user in mysql with password

CREATE USER 'username'@'hostname' IDENTIFIED BY 'password';


4. Revoke all privileges to new user

REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'username'@'hostname';


5. Grant required privileges to new user to specific database

GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES,EXECUTE ON databasename.* TO 'username'@'hostname';
6. Grant required privileges to new user to all databases

GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES,EXECUTE ON *.* TO 'username'@'hostname';


7. Commit the changes
FLUSH PRIVILEGES;


8. Exit from mysql

quit;


9. Test the above steps are working or not using below command:

mysql -u username -p -h hostname

provide the 'password'
10. After verification , exit from mysql

quit;




Friday 15 August 2014

Data Modeling in Graph Databases: Interview with Jim Webber and Ian Robinson

Graph databases are NoSQL database systems that use graph data model for storage and processing of data.
Matt Aslett from the 451 group notes that graphs are now emerging from the general NOSQL umbrella as a category in their own right. In the last 12-18 months there has been a shift in the graph space with growth in the category for all things graph.
Data modeling effort when using a Graph database follows a different paradigm than how you usually model the data stored in Relational or other NoSQL databases like Document databases, Key Value data stores, or Column Family databases. Graph data models can be used to create rich and highly connected data to represent the real world use cases and applications.
InfoQ spoke with Jim Webber and Ian Robinson in Neo Technologies team (also co-authors ofGraph Databases book) about the data modeling efforts and best practices when using Graph databases for data management and analytics.
InfoQ: What type of data is not suitable for storing in a Relational Database but is a good candidate to store in a Graph Database?
Jim & Ian: That’s pretty straightforward to answer: anything that’s interconnected either immediately, because the coding and schema design is complicated, or eventually, because of the join bomb problem [http://blog.neo4j.org/2013/01/demining-join-bomb-with-graph-queries.html] inherent in any practical application of the relational model.
Relational databases are fine things, even for large data sets, up to the point where you have to join. And in every relational database use case that we’ve seen, there’s always a join — and in extreme cases, when an ORM has written and hidden particularly poor SQL, many indiscriminate joins.
The problem with a join is that you never know what intermediate set will be produced, meaning you never quite know the memory use or latency of a query with a join. Multiplying that out with several joins means you have enormous potential for queries to run slowly while consuming lots of (scarce) resources.

Oracle Database Gets In-Memory

Oracle Database 12c Release 1 (12.1.0.2) is now available and includes the much anticipated “In-memory” feature, along with several other improvements.
Some important features introduced –
  • In-memory Column Store – Storing of objects in memory in a  Columnar format, with much better performance for scans, joins and aggregates
  • In-memory Aggregation- improves performance of star queries and reduces CPU usage
  • Advanced Index Compression
  • APPROX_COUNT_DISTINCT() – significantly faster than exact aggregation for large volumes of data, with negligible deviance
  • Attribute Clustering- allows storing logically related data in close physical proximity. Can greatly reduce amount of data to be processed and lead to better compression ratios
  • Full-Database Caching- Can be used to cache the entire database in-memory when the cache size is greater than the whole database size
  • JSON Support- Support for storing, querying and indexing JSON data, and allowing the database to enforce that the JSON stored conforms to the JSON rules
Kevin Closson points out that the In-Memory feature, which is licensed separately, could be used accidentally since it is on by default after the upgrade, and recommends caution.  
You can read the “new features” guide for a detailed list of improvements in this release.
Related Posts Plugin for WordPress, Blogger...