Page 1 of 1

Got 4 messages when run the command perl ./zmconfig.pl -noi

Posted: Wed Apr 14, 2004 7:50 pm
by linh
[root@localhost zm-1.19.1]# /etc/init.d/mysqld start
Starting MySQL:
/var/lib/mysql/mysql.sock does exist and the size is 0 Kilobytes.

[root@localhost zm-1.19.1]# perl ./zmconfig.pl -noi

Loading config from 'zmconfig.txt'
Loading config from DB

DBI connect('database=zm;host=localhost','admin',...) failed: Access denied for user: 'admin@localhost' (Using password: YES) at ./zmconfig.pl line 1476

Error: unable to load options from database: Access denied for user: 'admin@localhost' (Using password: YES)Saving config to 'zmconfig.txt'
Saving config to DB

DBI connect('database=zm;host=localhost','admin',...) failed: Access denied for user: 'admin@localhost' (Using password: YES) at ./zmconfig.pl line 1380

Error: unable to save options to database: Access denied for user: 'admin@localhost' (Using password: YES)

Generating 'src/zm_config_defines.h'
Processing 'src/zm_config.h'
Processing 'web/zm_config.php'
Processing 'scripts/zmdc.pl'
Processing 'scripts/zmwatch.pl'
Processing 'scripts/zmaudit.pl'
Processing 'scripts/zmfilter.pl'
Processing 'scripts/zmx10.pl'
Processing 'scripts/zmpkg.pl'
Processing 'scripts/zmupdate.pl'
Processing 'scripts/zmvideo.pl'
Processing 'scripts/zm'
Processing 'db/zmschema.sql'

[root@localhost zm-1.19.1]#

Posted: Wed Apr 14, 2004 8:06 pm
by zoneminder
Can you access mysql from the command line using your defined hostname, username and password?

If not then it is an issue with MySQL. Most likely you have either not created the users correctly, or not reloaded the permissions tables, or there is some typo.

If you can run

mysql -h<hostname> -u<username> -p<password>

and get to the mysql prompt then come back here as it's a ZM problem. If not then then reread the README and make sure you followed each step exactly.

Phil,

Reply to Phil

Posted: Wed Apr 14, 2004 8:39 pm
by linh
Hi Phil. Thank you for your help.

You said,

If you can run

mysql -h<hostname> -u<username> -p<password>

and get to the mysql prompt then come back here as it's a ZM problem. If not then then reread the README and make sure you followed each step exactly.

========================

1) I ran the command

[root@localhost mysql]# mysql -h localhost -u admin -p weboffice
Enter password: weboffice
ERROR 1045: Access denied for user: 'admin@localhost' (Using password: YES)

=======================

2) I then ran the same command again but without the -p weboffice

[root@localhost mysql]# mysql -h localhost -u admin

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25 to server version: 3.23.54

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

mysql>

======================

What is it mean ? Was the number 1 option correct or the number 2 option ?

Thank you for your help.

Posted: Wed Apr 14, 2004 8:58 pm
by zoneminder
It appears to mean that the 'admin' user does not require a password. However when you originally ran the 'grant...' commands to create and set permissions for your users, was admin one of them?

If not then try running mysql with those users. If 'admin' was one of those users, did you give a password (in the 'identified by ...' part)?

When you ran zmconfig.pl initially what did you give as the two database users?

Phil,

Posted: Wed Apr 14, 2004 9:30 pm
by linh
Hi Phil, and thank you for your help.
The user admin has a password of weboffice
The user johndoe has a password of johndoe

Below is my zmconfig.txt
===========================================

[root@localhost zm-1.19.1]# vi zmconfig.txt

Name: ZM_DB_SERVER
Value: localhost
Description: Machine on which the database server is running

Name: ZM_DB_NAME
Value: zm
Description: Database containing the tables

Name: ZM_DB_USERA
Value: admin
Description: Privileged DB user name, needs at least select, insert, update and delete privileges

Name: ZM_DB_PASSA
Value: weboffice
Description: Privileged DB user password

Name: ZM_DB_USERB
Value: johndoe
Description: Unprivileged DB user name, need just select privilege.

Name: ZM_DB_PASSB
Value: johndoe
Description: Unprivileged DB user password
===============================================

Below is the file /usr/local/zm-1.19.1/db/zmschema.sql
[root@localhost zm-1.19.1]# vi db/zmschema.sql

-- Create a default admin user.
--
insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit',NULL);
==============================================

1) Why is the account johndoe not in the file zmschema.sql ?
2) Does the admin account has a correct password ?
3) I did create an account name root as in
mysqladmin -u root password weboffice_sql
4) I then ran the command mysqladmin -u root -p version proc to show
that the mysql server is up and running and it is.
5) How does the root account created using
mysqladmin -u root password weboffice_sql is different from the
two account created using the command perl ./zmconfig.pl ?

[root@localhost mysql]# mysqladmin -u root -p version proc
Enter password:
mysqladmin Ver 8.23 Distrib 3.23.54, for redhat-linux-gnu on i386
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 3.23.54
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 50 min 49 sec

Threads: 1 Questions: 6 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 1 Queries
per second avg: 0.002
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+----+---------+------+-------+------------------+
| 13 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+

================================================

Also. I created a database allusers and then I
ran the command SHOW DATABASES, but there is none displayed.
I also looked in /var/lib/mysql/ directory, but the database allusers
is not there.

[root@localhost local]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 34 to server version: 3.23.54

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

mysql> CREATE DATABASE allusers
-> SHOW DATABASES
->
==============================================

Thank you for your help.