LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   MySql Permissions... I think (https://www.linuxquestions.org/questions/linux-general-1/mysql-permissions-i-think-12513/)

matt 01-23-2002 04:06 PM

MySql Permissions... I think
 
Howdy all,

Just got MySql installed, but there's weirdness. Long story short, I can start the daemon, but can't get into the mySql database or create a new one. It seems passwords / permissions are screwed up. I can get command line mySql with a blank password, which leads me to believe that no mysqladmin password has been set. But when I try to do anything that requires this password, I get access denied messages, which includes trying to set the mysqladmin password at the command line.

When I installed mySql, I did get the error message:

Error: 1062 Duplicate Entry 'localhost-root' for key 1

I understand that there is a way to start the server without the grant tables, but don't know the proper command. I've checked the documentation, but it does not give a clear example of how this works and my attempts at this have all failed.

It also looks like it may have installed twice, as in my usr/local folder there's a "mysql" as well as a "mysql-3.23.24" directory. Both have the same things in them, though I can no longer start the server out of the "mysql" directory, as I've probably fubar'ed it trying to fix the permissions with chown. It keeps giving me permission denied messages and will loop inself into trying to restart. I can start the server from the other directory, but cannot do anything useful with it, as mentioned above.

Could someone give me some advise? Should in uninstall / reinstall? I got my 500 page MySql book and I just want to get going.

Thanks,
)Matt.

notsoevil 01-23-2002 06:50 PM

After you did this:

#> make install

You should have done this

#> cd /path/to/your/mysql/bin
#> ./mysql_install_db

You said you were getting in with no root password, so I assume you did do the above. However, you didn't read the output because the command does stuff (sets up default tables and such) and then says something along the lines of:

"PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/path/to/your/mysql/bin/mysqladmin -u root -p password 'new-password'
/path/to/your/mysql/bin/mysqladmin -u root -h yourhostname -p password 'new-password'
See the manual for more instructions
"

The first mysqladmin command sets up the password for localhost, the second for remote connection to the server.

Did you do this?

If not, and you have been playing around with FILE permissions (not the same as MySQL permissions) and CHOWNs like you said, I would remove your two mysql directories, go back to the source, and just run 'make install' once more. Then follow the instructions above (mysql_install_db etc.).

matt 01-24-2002 12:03 PM

The reinstall seems to have done the trick - thanks!


All times are GMT -5. The time now is 10:44 AM.