mysql access denied

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
mrossTTX
Cacti User
Posts: 114
Joined: Wed Dec 07, 2022 12:49 pm

mysql access denied

Post by mrossTTX »

i know this isnt an mysql forum but.. on my 1.2.22 cacti server , on windows.. im trying to import a .sql file into the cacti database..
i am getting

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -u cactiuser -p cacti < ent.sql
Enter password: **********
ERROR 1045 (28000): Access denied for user 'cactiuser'@'localhost' (using password: YES)

i get this on cacti user or ROOT.. i cant login to mysql using any mysql tools.. anyone else see this and know a way to fix it without uninstalling and reinstalling mysql?
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: mysql access denied

Post by Osiris »

Did you set a root password in MySQL? If so, use that account. If you did not record/set the root password. It's easier to just start over.
Before history, there was a paradise, now dust.
mrossTTX
Cacti User
Posts: 114
Joined: Wed Dec 07, 2022 12:49 pm

Re: mysql access denied

Post by mrossTTX »

Osiris wrote: Sat Dec 17, 2022 7:07 am Did you set a root password in MySQL? If so, use that account. If you did not record/set the root password. It's easier to just start over.
i used the windows installer.. and im trying the pw that it puts in the text file it leaves behind.
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: mysql access denied

Post by TheWitness »

That's the way to do it. Keep it in a lock box.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mrossTTX
Cacti User
Posts: 114
Joined: Wed Dec 07, 2022 12:49 pm

Re: mysql access denied

Post by mrossTTX »

fyi finally fixed this.
had to make a text file in my c drive called mysql-init.txt
in that file is ALTER USER 'root'@'localhost' IDENTIFIED BY 'somenewpassword;
then stopped mysql service
open cmd as admin
ran "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" --init-file=C:\\mysql-init.txt

it will just stay up there, wont give you a response.. thats ok.
i opened mysql workbench, used my new pw.. set my root user to have all rights, then closed out of mysql workbench.
i killed that process i spawed with that command.
restarted the service.
voila.. i could log into mysql workbench and cmd line as root and create a seperate user to use and\or use root for what is needed..

hope this helps, remember to delete that mysql-init.txt file afterwards
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest