Mysql external connection

Discussion in 'General' started by pnaves, Jul 20, 2009.

  1. pnaves

    Joined:
    May 27, 2009
    Messages:
    66
    Likes Received:
    0
    I'm trying to connect to mysql server running in Elastix machine, but I did grant permissions to all users but the command affect 0 tables. And when I try a connection with Mysql Query Browser using my remote computer I have this message Access Denied For a user root@192.168.0.104 using password eLaStIx.2oo7

    I guess that the Mysql configuration not allowing connect from remote machines, but I have little experience with linux machines and I can't figure out what I have to do to fix it.

    Could someone give me the light?;)

    regards
     
  2. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    By default, mysql only allows local connections.

    Have a look here:

    http://www.devarticles.com/c/a/MySQL/Cr ... n-MySQL/1/

    Also have a look into mysql manual for user permissions, and set them according to your security policies.

    Allowing connections from root@"%" (% = any machine) is ok for testing, but I wouldn't allow it in a production server, but this is up to you.
     
  3. pnaves

    Joined:
    May 27, 2009
    Messages:
    66
    Likes Received:
    0
    I tried to type this commands:

    #mysql -u root -p
    (password is the same eLaS.... Etc etc
    Then after login

    GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO 'asteriskuser'@'192.168.20.0/24' IDENTIFIED BY 'eLaStIx.asteriskuser.2oo7' WITH GRANT OPTION;

    But, I got this error:

    Access denied for user 'root'@'localhost' to database 'asteriskcdrdb'.

    Whats happening??

    Please, help me!
     
  4. pnaves

    Joined:
    May 27, 2009
    Messages:
    66
    Likes Received:
    0

    Look at my attempt:


    [root@elastix ~]# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 17828
    Server version: 5.0.45 Source distribution

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> grant all privileges on *.* to root@"%";
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
     
  5. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    This happened to me a couple of times when I tried to change root permissions from localhost to % using webmin or phpmyadmin, I can't tell for sure.
    I don't remember very well how I solved it, it was a long time ago, but I think it was starting mysqld_safe with --skip-grant-tables or with --init-file=mysql.txt. You will have to read a little about mysql permissions. Or maybe someone else can help you here.

    Good luck, and if you find the solution please post it here to help some others in the same situation.
     
  6. pnaves

    Joined:
    May 27, 2009
    Messages:
    66
    Likes Received:
    0
    I don't know the reason but I did this using empty password!:)
     
  7. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    Is it a test machine or a production one?
    Maybe you'll finish faster reinstalling from scratch?

    But if you try to fix it, sure you'll learn more about mysql, and also help people in your same situation.
     
  8. viti

    Joined:
    Jun 30, 2009
    Messages:
    9
    Likes Received:
    0

Share This Page