PDA

View Full Version : MySQL permission problems


mdwfed
2008-08-07, 05:44 PM CDT
I believe I have Fedora Core 6 and I know mysql 5.03. I have started the mysql server and I am trying to install openconf. I have permission problems creating a database. Something about ''@'localhost' and permissions. This happens even when I su to "mysql" user or try to use the --user parameter. Any ideas how to fix the problems? the mysql directors seem to be properly installed with mysql user.

savage
2008-08-08, 10:47 PM CDT
Have a read through this (http://dev.mysql.com/doc/refman/5.0/en/adding-users.html) and this (http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html).

mdwfed
2008-08-10, 04:43 PM CDT
Have a read through this (http://dev.mysql.com/doc/refman/5.0/en/adding-users.html) and this (http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html).

I've done that now, but now turning PHP error messages on, the mysql functions aren't being recognized. Somehow I'm thinking it is easier to install the software from scratch then to use the pre-installed Fedora stuff....

Is there a way to get PHP to recognize mysql functions without reinstalling???

This is the PHP error:
Call to undefined function mysql_connect() in /usr/local/www/cpsc/openconf/openconf/chair/install-db.php on line 24


Mary

savage
2008-08-10, 05:39 PM CDT
Try: yum install php-mysql

mdwfed
2008-08-11, 07:14 AM CDT
I am working on that now. Will the database user be the user who owns that set of web site files or the user for apache?

Mary

markkuk
2008-08-11, 07:43 AM CDT
MySQL has its own account management system that has nothing to do with Linux user accounts. Your database user isn't any Linux user, even if the MySQL username happens to be the same as some Linux username.

savage
2008-08-11, 05:37 PM CDT
As markkuk said, MySQL and system users are completely separate, see the links above for how to create a new user for your PHP application.

I wouldn't recommend using the root user incase your app has any vulnerabilities, create a restricted user that only has access to the databases/tables that it needs.

If your not comfortable using the mysql command line, have a look for "MySQL Administrator" and "MySQL Query Browser" on the mysql site. Not sure if they're available on Linux (I'd guess at yes), but they provide a nice click-through GUI to setup users and databases/tables.

Edit: See here (http://dev.mysql.com/downloads/gui-tools/5.0.html) to download them :)

mdwfed
2008-08-12, 11:19 AM CDT
As markkuk said, MySQL and system users are completely separate, see the links above for how to create a new user for your PHP application.

I wouldn't recommend using the root user incase your app has any vulnerabilities, create a restricted user that only has access to the databases/tables that it needs.

If your not comfortable using the mysql command line, have a look for "MySQL Administrator" and "MySQL Query Browser" on the mysql site. Not sure if they're available on Linux (I'd guess at yes), but they provide a nice click-through GUI to setup users and databases/tables.

Edit: See here (http://dev.mysql.com/downloads/gui-tools/5.0.html) to download them :)

Command line is fine, but my first attempt to create another user and use it failed. But then maybe I typed something wrong. Root does access the database now though. Thanks.

Mary