MySQL 4.x questions...
Peter Risdon
peter at circlesquared.com
Fri Jan 30 05:22:13 PST 2004
Eric F Crist wrote:
>Hey all,
>
>I installed MySQL server 4.1.0_1 to support the PostNuke CMS and the phpBB
>bulletin board system. For the life of me, I can't get a database setup for
>either of them to use. Both users groups tell me that there's a mysql
>problem with configuration. Here are the errors:
>
>phpBB:
>
>Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource
>in /www/seccomp/htdocs/phpBB2/db/mysql4.php on line 330
>
> Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource
>in /www/seccomp/htdocs/phpBB2/db/mysql4.php on line 331
> phpBB : Critical Error
>
> Could not connect to the database
>
>PostNuke:
>
>No database made.Error connecting to db
>Program: /www/seccomp/htdocs/pn/install/db.php - Line N.: 45
>Database: seccomp-nuke
> Error (1044) : Access denied for user: '@localhost' to database
>'seccomp-nuke'
>
>Can someone tell me what I need to setup to get this working right? I've been
>feeling pretty worthless with this stuff lately. I've never needed this much
>help. Maybe I'm just trying to do too much at once?
>
>TIA
>
>
This is a general answer, not specific to phpnuke or phpBB, neither of
which I am famil.iar with.
Applications that use a mysql backend generally come with database
schema (often a file called something.sql) and need to be configured
with a valid user name and password. The process for setting these apps
up is as follows:
1. install the port.
2. setup the database for the app with:
#mysqladmin create databasename
(see the app documentation for the correct database name to use)
3. Then grant the relevant permissions top the username the app is going
to want to use (again see docs). It's generally safe to log into mysql
as root and grant all. Mysql installs with a blank root password so if
you haven't changed this (and you should!), you can login as follows:
#mysql -u root databasename
Then use the following statement to grant all:
mysql> grant all on databasename.* to username at localhost identified by
"password";
4. Set up the schema as follows:
#mysql -u username -p databasename < schemafile.sql
5. You then need to make sure the correct user name and password are in
the app's config scripts. This usually an include file with php apps.
HTH.
PWR.
More information about the freebsd-questions
mailing list