Solved

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

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

777 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