Solved

Connect to mysql database with read-only mode hosted on different server

Posted on 2013-02-07
2
584 Views
Last Modified: 2013-02-15
Hi Experts!

I need to connect to mysql database from different server (basically any server) in read only mode and access just one table. How to do it? First of all I need to use this piece of code in my phpmyadmin:
CREATE USER 'user'@'%' IDENTIFIED BY 'user';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION;

Open in new window

Is it enough to just modify this code somehow or do I need to do something more?
Thanks.
0
Comment
Question by:Zado
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 38865224
In phpMyAdmin, each database has a 'Privileges' tab where you can choose the privileges you want a user to have on that database after you create the user.  You can restrict the user to having only Select privileges which is basically Read-Only.  Using the phpMyAdmin edit screen is a lot easier than trying to figure out the privileges list yourself.
0
 
LVL 8

Author Comment

by:Zado
ID: 38893740
Just incase someone will experience similar problem, here's how to enable remote access to mysql server (connect from any server with wildcard '%'):
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question