Solved

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

Posted on 2013-02-07
2
580 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
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now