Solved

Mysql error - connecting to DB issue

Posted on 2011-09-07
8
373 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

809 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