From: Dan F. <dfr...@cs...> - 2004-07-26 00:41:14
|
These are really not Phpwiki questions, they are MySQL questions. As such, I'd advise learning a little more about MySQL in general. Read the docs at mysql.com in some detail about configuration. I fear replying to any more of this, because I'll just attract further MySQL questions. It's too hard to teach over email. However, I will give one more shot, though it's a guess. First, you have to realize that MySQL does not grant permissions to users. Rather, it grants permission to (user, host) pairs. Furthermore, localhost is a special kind of host, different from others. The '%' is a wildcard for any host, but I believe it does not include localhost. Thus, if you've granted permissions to user@%, that is different from permissions for user@localhost. From the below, it looks like you don't have any perms for user@localhost, yet your phpwiki config looks like it is trying to use that. So you should grant them to user@localhost, or change your Phpwiki dsn to use user@<machine>. Sounds like maybe you did some of this (you made a "duplicate" user, who's not really duplicate since it's a different host, but I'm not sure what its perms are). Furthermore, if it still doesn't work, I'd try granting all perms instead of just what it says in the docs. Finally, make sure when you test perms at the command line, that you are using exactly the same connection as for Phpwiki (e.g., your socket must also be the same if you use localhost, not obvious from below; read for example http://dev.mysql.com/doc/mysql/en/Problems_with_mysql.sock.html and use mysql --help to see which socket it is connecting to). Please, no more. :-) It's too hard to teach someone how to use MySQL over email. Dan Arthaey Angosii wrote: >Continuing to work at this problem, I set MySQL's my.cnf to include: > >==================== >[mysqld] >tmpdir=/var/lib/mysql/tmp >==================== > >After restarting mysqld, I got a different error message, one with a >surprising about of useless links from Google: > >==================== >lib/WikiDB/backend/PearDB.php:35: Fatal[256]: Can't connect to >database: wikidb_backend_mysql: fatal database error > > * DB Error: connect failed > * ( [nativecode=Link to server lost, unable to reconnect] ** >mysql://wiki:XXXXXXXX@localhost(/var/lib/mysql/mysql.sock)/phpwiki) > * >==================== > >The MySQL user wiki's information is thus, according to phpMyAdmin: > >==================== >User Host Type Privileges Grant >wiki % database-specific SELECT, INSERT, UPDATE, DELETE, >LOCK TABLES No >==================== > >Which is what doc/INSTALL.mysql says is all that's required for the wiki user. > >Dan Frankowski wrote: > > >>Thus, probably that file doesn't have permissions to be read by the user >>who's making the Phpwiki request (probably the user running your Apache >>process). >> >> > >Next, I tried investing permissions further. I set apache as the user >and group of /var/lib (which contains the mysql directory); the >permissions had previously been set to root. New error message: > >==================== >lib/WikiDB/backend/PearDB.php:35: Fatal[256]: Can't connect to >database: wikidb_backend_mysql: fatal database error > > * DB Error: connect failed > * ( [nativecode=Access denied for user: 'wiki@localhost' (Using >password: YES)] ** >mysql://wiki:XXXXXXXX@localhost(/var/lib/mysql/mysql.sock)/phpwiki) >==================== > >This was surprising, since wiki certainly *used* to have permissions. >But lo and behold, when I tried to access the MySQL database from the >command line: > >==================== >[root@localhost var] $ mysql -u wiki -p phpwiki >Enter password: ********** >ERROR 1045: Access denied for user: 'wiki@localhost' (Using password: YES) >==================== > >The MySQL command "show grants for 'wiki'@'localhost'" showed that >there were NO privileges for wiki -- but they were set for wiki@%. I >made a duplicate user, wiki@localhost, that fixed the problem of >logging in as wiki from the command line. > >However, that put me back to the "Link to server lost, unable to >reconnect" error message. I'm out of ideas; what should I try next? > > >-- >AA > >PS -- Thanks for your quick reply. :) > > >------------------------------------------------------- >This SF.Net email is sponsored by BEA Weblogic Workshop >FREE Java Enterprise J2EE developer tools! >Get your free copy of BEA WebLogic Workshop 8.1 today. >http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click >_______________________________________________ >Phpwiki-talk mailing list >Php...@li... >https://lists.sourceforge.net/lists/listinfo/phpwiki-talk > > |