Solved

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

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

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Creating and Managing Databases with phpMyAdmin in cPanel.
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 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

11 Experts available now in Live!

Get 1:1 Help Now