Upgrading the database - mysql says "Access denied"

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Upgrading the database - mysql says "Access denied"

Post 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....
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

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

Post 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
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

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

Post 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,
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

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

Post 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... :/
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

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

Post 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,
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

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

Post 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. ;)
Locked