1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

MySQL default host

Discussion in 'Plesk for Linux - 8.x and Older' started by Panther, May 24, 2006.

  1. Panther

    Panther Guest

    Since Plesk 8.0, the default host name for MySQL users created by Plesk is the wildcard '%'. In Plesk 7.5 it was always "localhost". It appears that the wildcard works for everything but the localhost, so users are not able to access the databases they create without the admin going in and changing the host names to "localhost" in the mysql database user table.
  2. fishnyc22

    fishnyc22 Guest

    I'm having the same problem. In fact. crating a new user and setting the host to % or localhost, I can't access the database at all.

    I get this error:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myusername'@'localhost' (using password: YES) in /var/www/vhosts/mydomain.com/subdomains/dev/httpdocs/index.php on line 167
    error connecting: Access denied for user 'myusername'@'localhost' (using password: YES)

    I'm using 8.0.1
  3. abulava

    abulava Guest

    It seems I found a solution. In a nutshell, I followed an advice from Paul DuBois of MySQL Documentation Team: "Check the user table to see if there is an account with a Host value of 'localhost' and a User value of '' (empty string). If there is, remove it (DELETE FROM user WHERE Host='localhost' AND User='') and then do FLUSH PRIVILEGES." (look at http://archives.neohapsis.com/archives/mysql/2004-q1/3549.html if in doubt)

    The issue I suffered from was described in MySQL 3.23, 4.0, 4.1 Reference Manual, 5.7.5. Access Control, Stage 1: Connection Verification ( http://dev.mysql.com/doc/refman/4.1/en/connection-access.html ).

    Unfortunately, it was a default setup of MySQL in CentOS 4 (and RHEL 4 too, I guess) to put an account with a Host value of 'localhost' and a User value of '' (empty string) into mysql.user table. :(
  4. gijsbert

    gijsbert Basic Pleskian

    Aug 22, 2001
    Likes Received:
    It is indeed the default setup on CentOS4 (I don't know for RHEL4).

    When installing Plesk after the default setup, the localhost-row with empty pass is erased (I think by the psa-installer) but from that moment on, plesk always use the percent-sign when setting up a database.

    So, if you erase the localhost with empty-pass line before installing plesk, no problem. Does anyone know a solution how to fix this after plesk has been installed on a server where the localhost/empty-pass line was present during the installation?
  5. benbroad

    benbroad Guest

    If anyone has a solution for this I would be grateful. I can work with the wildcard "allow from anywhere" %, but it doesn't sit right with my paranoid brain.