Page 1 of 1

Upgrading the database - mysql says "Access denied"

Posted: Thu Mar 18, 2004 9:21 pm
by lazyleopard
I presume I've missed something blindingly obvious, or doing something mind-bogglingly stupid, but I can't get mysql to upgrade my database for 1.19.0. This is what happens:

/usr/local/src/zm-1.19.0/db# mysql zm -u webcam -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13437 to server version: 3.23.49-log

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

mysql> \. zmalter-1.18.1.sql
ERROR 1044: Access denied for user: 'webcam@localhost' to database 'zm'
ERROR 1054: Unknown column 'Type' in 'field list'
ERROR 1044: Access denied for user: 'webcam@localhost' to database 'zm'
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0

ERROR 1044: Access denied for user: 'webcam@localhost' to database 'zm'
ERROR 1044: Access denied for user: 'webcam@localhost' to database 'zm'

The "optimize" stuff seems to work Ok. 'webcam' is the user with 'select,insert,update,delete' and I did give it the correct password....

Re: Upgrading the database - mysql says "Access denied"

Posted: Thu Mar 18, 2004 9:50 pm
by zoneminder
Hi Rick,

I'm not sure about using that form. Usually I just do

<i>mysql zm -u webcam -p 'password' < zmalter-1.18.1.sql</i>

Have you tried that?

Phil

Re: Upgrading the database - mysql says "Access denied"

Posted: Thu Mar 18, 2004 9:51 pm
by zoneminder
Whoops, missed the most obvious part which is that you you need to be doing it as a user with 'alter' privilege. This will probably be the 'root' user, or whoever you were when you 'grant'ed the ZM user privileges.

Phil,

Re: Upgrading the database - mysql says "Access denied"

Posted: Thu Mar 18, 2004 10:21 pm
by lazyleopard
Well, I thought I'd just used the instructions in the README to set up the database in the first place, and zm is the only thing using mysql, and I don't remember setting up any specific system manager ID, but when I tried:

/usr/local/src/zm-1.19.0# mysql zm < db/zmalter-1.18.1.sql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

so now I'm wondering what got set up by default... :/

Re: Upgrading the database - mysql says "Access denied"

Posted: Thu Mar 18, 2004 10:38 pm
by zoneminder
You should be able to do

<i>mysql mysql</i>

and then

<i>select * from user;</i>

to see what users you have, and

<i>select * from db;</i>

might also shed some light.

Phil,

Re: Upgrading the database - mysql says "Access denied"

Posted: Thu Mar 18, 2004 11:16 pm
by lazyleopard
At that point life got interesting....

/usr/local/src/zm-1.19.0# mysql mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

Some poking around in the guts of mysql, and judicious use of the strings command revealed that root@localhost did seem to have a password assigned. A few dozen tries with "mysql mysql -p" eventually revealed what it was, and it wasn't one that surprised me much, but I still don't know when it got set.

Anyway, database now updated. On with the upgrade. Thanks. ;)