Solved

Mysql error - connecting to DB issue

Posted on 2011-09-07
8
369 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
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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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.:

746 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

10 Experts available now in Live!

Get 1:1 Help Now