Solved

Mysql error - connecting to DB issue

Posted on 2011-09-07
8
377 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
Stressed Out?

Watch some penguins on the livecam!

 
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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

705 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