LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   MYSQL:Access denied!!!! (https://www.linuxquestions.org/questions/linux-networking-3/mysql-access-denied-511918/)

immortaltechnique 12-19-2006 08:47 AM

MYSQL:Access denied!!!!
 
:scratch: Hi all now am trying to install cacti and i followed the instructions quite easily. Now when i try to access the web interface i get the following error which is in relation to importing the defauldt cacti database to the mysql:
Code:

Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:

mysql -u cactiuser -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.

So i run the above command and i still get the same error. Now that's not all. When i try to access mysql i get the following:
Quote:

mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
I have a cacti user who can login to mysql but cannot update the grant tables which is part of the cacti installation.
While you guys are still at it could you give me the best way to uninstall mysql?
cheers

r.stiltskin 12-19-2006 09:16 AM

Your command is incomplete.

Try
Code:

mysql -u root -p

immortaltechnique 12-19-2006 09:35 AM

ok even with that it still asks for a password yet when i give it the password:
Code:

mysql>  GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'me'; ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'cacti'
Is this to mean that the root user cannot perform tasks such as provide grants to the users in the databases?

jstephens84 12-19-2006 09:43 AM

have you ran the mysql_install_db and ran the mysqladmin -u root password 'password_here'

r.stiltskin 12-19-2006 10:01 AM

What jstephens84 means is that you may not have run the commands to initially set up the mysql root passwords. You should run both of these, if you haven't already:
Code:

mysqladmin -u root -h 'hostname' password 'password'
mysqladmin -u root password 'password'

They can both be the same password. Note this is just a password for mysql admin, not your Linux root password (could be the same, but probably not a good idea).

jstephens84 12-19-2006 10:51 AM

the mysql_install_db also installs the system database and setups up the permissions. So at this point in time root may not have the appropriate permissions.

immortaltechnique 12-19-2006 10:09 PM

Quote:

What jstephens84 means is that you may not have run the commands to initially set up the mysql root passwords. You should run both of these, if you haven't already:
Code:

mysqladmin -u root -h 'hostname' password 'password' mysqladmin -u root password 'password'

Now here is the output of the first command you gave me:
Quote:

mysqladmin: unable to change password; error: 'Access denied for user ''@'jkuatdb' to database 'mysql''
Where jkuatdb is the name of my host though even if i change it to localhost i get the same error.
...And for the second one:
Quote:

error: 'Access denied for user 'root'@'localhost' (using password: NO)'
At this point there's really nothing much i can do with my database.

jstephens84 12-21-2006 04:54 PM

what do you get when you run
Code:

mysqladmin -u root password '<your password>'


All times are GMT -5. The time now is 11:36 PM.