PDA

View Full Version : MySQL's user tables Read Only?



mcaycedo
01-31-2004, 07:11 AM
I have been playing with Apache - PHP - Mysql with Knoppix. I was really impressed when I was able to use some dinamic web pages accesing some MySQL tables. Everithing works without a glitch.

But when I try to create some users and grant special privileges, BANG, Mysql's user tables are read-only.

So? What do you do when yo want to create some users? I try to create the users with sudo and haven't any luck neither.

Any ideas?

tearinghairout
01-31-2004, 08:54 AM
What do you mean by create some users? Are you talking about Linux users or Mysql users? If you create new Linux users, you also have to separately set them up in Mysql as well.

If you haven't already done so, I suggest getting hold of a copy of phpmyadmin.
You can apt-get install this from the debian sites, and it provides a quite useful web driven gui Mysql utility for managing databases, users, tables, queries etc.

Once it is installed, you must restart apache, then access it via http:/localhost/phpmyadmin/

mcaycedo
01-31-2004, 04:31 PM
I'm talking about MySQL users. I enter to the MySQL console, and then I type:

mysql>GRANT ALL ON mydatabase.* TO none@% IDENTIFIED BY "pass";

Then I received the message that MySQL user tables are read only. In this case, I imagine that PhpMyAdmin will have the same problem trying to create users, because he will send the same sentence to the MySQL engine

tearinghairout
01-31-2004, 09:58 PM
Can you paste in the exact error message it is returning?

Thanks

mcaycedo
01-31-2004, 11:49 PM
knoppix@ttyp0[knoppix]$ sudo /etc/init.d/mysql start
Starting MySQL database server:mysqld
knoppix@ttyp0[knoppix]$ sudo mysql
Welcome to the MySQL monitor. Conmands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.16-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>GRANT ALL ON test.* TO none@192.168.0.7 IDENTIFIED BY "pass";
ERROR 1036: Table 'user' is read only
mysql>

tearinghairout
02-01-2004, 02:36 AM
Check the permissions of the files in /var/lib/mysql/mysql. They should all be owned by user mysql and group mysql, mode 660.

mcaycedo
02-01-2004, 04:32 AM
That's the way. I check the files in /var/lib/mysql/mysql. There are no files, only links to files placed in /KNOPPIX/var/lib/mysql/mysql. So, I delete the links placed in /var/lib/mysql/mysql, copy the files placed in /KNOPPIX/var/lib/mysql/mysql. Change permission to 777 and voila, everything works fine. I was able to create mysql users

Thanks for the ideas

fingers99
02-01-2004, 06:40 AM
Change permission to 777 and voila, everything works fine. I was able to create mysql users

OK, it works, but _anyone_ can now create mysql users. Including I_am_a_mad_cracker! Mind you, for non-production, on my own system, use, this may be fine.

I'm not sure of the answer, (3 years or so since I used MySQL) but doesn't MySQL itself have a root user (that is, an entity with administrative rights over MySQL.)?

mcaycedo
02-01-2004, 03:48 PM
Yeah, I know, 777, is a little drastic, but of course this is only in a development machine. Offf course if I want to deploy something more serious I would create te appropiate users, with the level of permissions adecuate.

In this case, I just was trying to explore the capabilities of the liveCd, and I'm more impressed. It's awesome.