The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Each user can see all databases in phpmyadmin

Discussion in 'Database Discussions' started by oanielsen, Dec 30, 2004.

  1. oanielsen

    oanielsen Member

    Joined:
    May 14, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Just upgraded to most recent STABLE release 9.9.9 R15. Now, in phpMyadmin, each user can see all the databases on the server in the dropdown list. Anyone know how to fix this??
     
  2. Rooter

    Rooter Well-Known Member

    Joined:
    Apr 23, 2003
    Messages:
    146
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    Root Administrator
    Users have access all MySQL databases via phpMyAdmin

    Did you upgrade from MySQL 3 to MySQL 4?

    Try this in SSH as root. Replace mysqlrootpassword with your actual MySQL root password.
    Code:
    mysql_fix_privilege_tables mysqlrootpassword
    
    mysql mysql -u root -p
    <Enter the MySQL root password when it prompts you>
    
    update `user` set Create_tmp_table_priv = 'N', Lock_tables_priv = 'N' where user <> 'root';
    flush privileges;
    \q
    That should fix it.
     
    #2 Rooter, Dec 30, 2004
    Last edited: Dec 31, 2004
  3. oanielsen

    oanielsen Member

    Joined:
    May 14, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    When I do the

    update `user` set Create_tmp_table_priv = 'N', Lock_tables_priv = 'N' where user <> 'root';


    statement, I get the following error:



    ERROR 1046: No Database Selected


    do I need to do some type of "connect" statement first?

    Thanks,
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Nick created a script to do this, all you should need to do is run:

    /scripts/cleanupmysqlprivs
     
  5. Rooter

    Rooter Well-Known Member

    Joined:
    Apr 23, 2003
    Messages:
    146
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    Root Administrator
    Edited my post above, give that correction a shot.

    Ah, very cool. Never knew about it. :)
     
  6. oanielsen

    oanielsen Member

    Joined:
    May 14, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    I have done each of the thing that was suggested, to no avail. You can still see all the DB's in the drop down list in phpmyadmin. You can't do anything to the ones you don't own, but you can see them, and a drop-down list of over 50 DB's is a little bothersome to customers, not to mention with the DB naming, each customer and see all other customers usernames. NOT GOOD.
     
  7. brentp

    brentp Well-Known Member

    Joined:
    Mar 11, 2004
    Messages:
    324
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ayr, North Queensland, Australia
    Try running /scrips/grabmysqlprivs ( i think thats it) and it usually fixes it for me.

    Regards,
    Brent
     
  8. oanielsen

    oanielsen Member

    Joined:
    May 14, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the advice, but still not working. :mad:
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Have you logged the issue with cPanel? If not, you should.
     
  10. oanielsen

    oanielsen Member

    Joined:
    May 14, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Just did, hope I get a response.
     
  11. philb

    philb Well-Known Member

    Joined:
    Jan 28, 2004
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    You can often see all the databases on a server, this is something that is a simple toggle on user permissions in MySQL 4, but I don't believe MySQL 3 allows you to disable.

    However, it should be pointed out that being able to see the databases, while a mild information disclosure (users know what databases and usernames are likely to be valid) they shouldn't actually be able to do anything with the database.
     
  12. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    I'm still using mysql 3.23.56 (yes, should be upgrading soon) and phpmyadmin (2.6.0-pl3) only shows the user's own databases. This is with cPanel 9.9.9-S15. And as far as I know, and what I've seen, it's always been that way for me.
     
  13. philb

    philb Well-Known Member

    Joined:
    Jan 28, 2004
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Hm. phpMyAdmin can be configured to only show databases the user has write access to, as I recall. Perhaps somewhere along the line this has been lost on oanielsen's install?
     
  14. oanielsen

    oanielsen Member

    Joined:
    May 14, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    All my Cpanel 3rd party apps have functioned perfectly for over 2 years, and this upgrade has been the only one that has cause problems. I have done no special modding of phpmyadmin, and no upgrades to Mysql, so I still would love to know what made this happen. I entered a trouble ticket a few days ago and still no response!
     
  15. Alexandre Duran

    Alexandre Duran Well-Known Member

    Joined:
    May 6, 2003
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Rio de Janeiro - BRAZIL
    Open the my.cnf file in /etc:

    pico /etc/my.cnf

    Should be (or something like this):

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    Put safe-show-database in [mysqld] :

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    safe-show-database

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    Save and restart mysql (works in Mysql 3.XX).

    Original POST : http://forums.cpanel.net/showthread.php?t=18806&highlight=safe-show-database
     
    #15 Alexandre Duran, Jan 9, 2005
    Last edited: Jan 9, 2005
  16. oanielsen

    oanielsen Member

    Joined:
    May 14, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Thanks Alexandre!! that finally worked! It's great that it was an easy fix, but I still question why it happend in the first place
     
Loading...

Share This Page