SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost' [SOLVED]

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
User avatar
michaelbr
Posts: 25
Joined: Wed Apr 05, 2023 10:25 am

SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost' [SOLVED]

Post by michaelbr »

My PC crashed yesterday, installed before crash ZM 1.36.X without problem, but this time got an error when trying to restart mysql service

Code: Select all

sudo service mysql restart
(with error "mysql: unrecognized service"), after changing

Code: Select all

/etc/mysql/mariadb.conf.d/50-server.cnf
file, could connect to mariadb using

Code: Select all

mysql -uroot -p
, mysql is not in init.d, but mariadb is, so instead restarted mariadb using

Code: Select all

sudo service mariadb restart
. Then installed ZM using

Code: Select all

zm-install
script, when tried to run ZM, got the following error:

Code: Select all

Unable to connect to ZM db using dsn mysql:host=localhost;dbname=zm;charset=utf8
SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost'
What I'm doing wrong? Is it because of the mysql service can't restart or some other reason? How can I solve this problem?
OS: MX Linux 21.3 (Debian 11 based)
Last edited by michaelbr on Mon May 29, 2023 8:43 am, edited 1 time in total.
Thanks for your comment/suggestion
Michael
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost'

Post by Magic919 »

Sounds like DB is running. Cannot auth as ZM user/pass.
-
User avatar
michaelbr
Posts: 25
Joined: Wed Apr 05, 2023 10:25 am

Re: SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost'

Post by michaelbr »

Magic919 wrote: Sat May 27, 2023 3:52 pm Sounds like DB is running. Cannot auth as ZM user/pass.
That's the problem, I can't find the db named zm and user named zmuser, does ZM requires both MySQL AND MariaDB to work, or either one of them is enough? If zm and zmuser is in MySQL, what MariaDB is doing there? Can I install MySQL before installing ZM? will ZM wipe out MySQL installation?
Thanks for your comment/suggestion
Michael
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost'

Post by Magic919 »

You can use EITHER MySQL or MariaDB. I use MariaDB with ZM. It’s thought to perform a bit better. Some of the MySQL commands work with MariaDB as they are very similar. It’s basically a drop in replacement.
-
User avatar
michaelbr
Posts: 25
Joined: Wed Apr 05, 2023 10:25 am

Re: SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost'

Post by michaelbr »

Magic919 wrote: Sun May 28, 2023 3:14 pm You can use EITHER MySQL or MariaDB. I use MariaDB with ZM. It’s thought to perform a bit better. Some of the MySQL commands work with MariaDB as they are very similar. It’s basically a drop in replacement.
Thanks for your reply, it seems that I need to create zmuser & zm DB manually, for zmuser, do I need password for this user when creating? If so where in ZM I have to write this password (which configuration file so that ZM can connect it to zm DB?)
Thanks for your comment/suggestion
Michael
User avatar
michaelbr
Posts: 25
Joined: Wed Apr 05, 2023 10:25 am

Re: SQLSTATE[HY000] [1698] Access denied for user 'zmuser'@'localhost' [SOLVED]

Post by michaelbr »

Followed this post and it solved my problem to install ZM on MX Linux.
Thanks for your comment/suggestion
Michael
Post Reply