Solved

Mysql error - connecting to DB issue

Posted on 2011-09-07
8
375 Views
Last Modified: 2012-05-12
Hi All,
i have created one script to create mail boxed on our server but during connecting to DB : it shows :
"ERROR connecting to DB: as abcuser Host 'hostname' is not allowed to connect to this MySql server"

help where i need to look and waht to modify ....?
0
Comment
Question by:coolcap
[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
8 Comments
 
LVL 8

Expert Comment

by:pilson66
ID: 36494431
in mysql server, do:
grant all no dbname.* to user@your_ip identified by 'password';
flush privileges;
0
 
LVL 8

Expert Comment

by:pilson66
ID: 36494433
in mysql server, do:
grant all on dbname.* to user@your_ip identified by 'password';
flush privileges;
0
 

Author Comment

by:coolcap
ID: 36494672
where ..please tell me the proper steps ...and files where to edit ?
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 8

Accepted Solution

by:
pilson66 earned 350 total points
ID: 36494713
you need im mysql server to add permissions to connect to your database from your IP-address with username and password


GRANT
    priv_type [(column_list)]
      [, priv_type [(column_list)]] ...
    ON [object_type] priv_level
    TO user_specification [, user_specification] ...
    [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]
    [WITH with_option ...]

object_type:
    TABLE
  | FUNCTION
  | PROCEDURE

priv_level:
    *
  | *.*
  | db_name.*
  | db_name.tbl_name
  | tbl_name
  | db_name.routine_name

user_specification:
    user [IDENTIFIED BY [PASSWORD] 'password']

ssl_option:
    SSL
  | X509
  | CIPHER 'cipher'
  | ISSUER 'issuer'
  | SUBJECT 'subject'

with_option:
    GRANT OPTION
  | MAX_QUERIES_PER_HOUR count
  | MAX_UPDATES_PER_HOUR count
  | MAX_CONNECTIONS_PER_HOUR count
  | MAX_USER_CONNECTIONS count
0
 
LVL 4

Expert Comment

by:nfaria
ID: 36496529
Issue a SELECT * FROM mysql.user WHERE user like 'abcuser'; and see what user(s) with that ID are allowed and from where. Host column tells you from what machine or networked is abcuser allowed to login.

And please read this page to understand how to fix it.
http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
0
 

Author Comment

by:coolcap
ID: 36496617
Sorry ..but i am a=unable to find these parameters ..if u could help me to tell the location or file of these parameters? m new to mysql :(
0
 
LVL 6

Assisted Solution

by:mohansahu
mohansahu earned 150 total points
ID: 36501437
Hi,

Do the following steps..

1.Grant access to remote IP address

Connect to mysql server:
$ mysql -u root -p mysql

2.mysql> GRANT ALL PRIVILEGES ON databasename.* TO user@'hostname' IDENTIFIED BY 'PASSWORD';

3. mysql>flush the privileges;

Note:- change the database name & hostname of your PC.

MS
0
 

Author Closing Comment

by:coolcap
ID: 36535315
thanks all
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FTP Script 25 68
reverse engineer .sql from php files 11 54
Advice on ESXi 5.1 Health / Storage 1 48
MySQL stored procedure returning null values 4 29
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Creating and Managing Databases with phpMyAdmin in cPanel.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

730 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