?
Solved

Mysql error - connecting to DB issue

Posted on 2011-09-07
8
Medium Priority
?
381 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
LVL 8

Accepted Solution

by:
pilson66 earned 1050 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 450 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

770 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