Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just installed mysql with the rpm file and I can't seem to login as the root mysql user. Do I need to be logged in as the root computer user to login as the root mysql user or anything like that? I''ve tried uninstalling it and reinstalling it with no luck at all so any suggestions would be appreciated.
Could you post how you are trying to log in and what the error messages are? You do NOT need to be logged into your machine as root as the MySQL root and the system root are two different things. Also, my understanding of rpm installation is that the root user does NOT have a password to begin with, so if you are trying to use one that may cause an error.
I tried doing that through mysqladmin and got the following error message
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
Than I try to use the mysql database but I get this since im not logged in as root mysql user
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
I've tried flushing privileges but I get this error
ERROR 1227: Access denied. You need the RELOAD privilege for this operation
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465
Rep:
Ok.. You can the do the procedure for resetting the root password is as follows:
1. Log on to your system as either the Unix root user or as the same user that the mysqld server runs as.
2. Locate the `.pid' file that contains the server's process ID. The exact location and name of this file depend on your distribution, hostname, and configuration. Common locations are: `/var/lib/mysql/', `/var/run/mysqld/', and `/usr/local/mysql/data/'. Generally, the filename has the extension of `.pid' and begins with either `mysqld' or your system's hostname. Now you can stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the name of the `.pid' file in the following command:
Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command.
3. Restart the MySQL server with the special --skip-grant-tables option:
shell> mysqld_safe --skip-grant-tables &
4. Set a new password for the root@localhost MySQL account:
I did the above and it didn't seem to work. So I tried some other things mainly uninstalling the rpm and trying to get the binary to work but I must of messed something up . Now my mysql.sock seems to have gone missing and im wondering as how to replace it? Also I have reinstalled the rpm and I would of thought that the mysql.sock file would been remade if it was deleted but it apparently it wasn't. Any help would greatly be appreciated.
Usually what Gerardoj and Hangdog42 say works, but... do you have RH9? I had the same problem with it. No problems with 7.3 or Debian.
I first tried to log in as admin, succeeded but had no access to the databases.
Code:
root@rh9box:root# mysql -uadmin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
So well I did what sould never be done:
Code:
rh9box:~$ cd /var/lib/mysql
rh9box:/var/lib/mysql$ mv mysql mysql.old
rh9box:/var/lib/mysql$ scp -r rh73box:/var/lib/mysql/mysql .
rh9box:/var/lib/mysql$ service mysqld stop
rh9box:/var/lib/mysql$ service mysqld start
And then I could log in with the password from my other box!
I think you can use instead of rh73box a Knoppix CD (there should be a mysql server in there, and so you can get the mysql directory and log in as root with no pw, as said before).
Well I figured out what was wrong and fixed it. Apparently when I was uninstalling the rpm it wasn't deleting all the files. So I did a locate mysql and deleted all the files be hand and installed it from the binary version and it worked perfectly.
In my experience, I've always had to use (minimally) 'mysql -u root -p' and then it prompts for a password. The line "error: 'Access denied for user: 'root@localhost' (Using password: NO)'" usually indicates that you're not supplying a password (even a blank password must be "supplied").
I had similar problems and just thought I could add my 2¢ worth.
Originally I had changed my host settings in
/usr/local/phpMyAdmin-2.6.0-rc1/config.inc.php
which I later discovered that I should keep the setting localhost instead of my hostname frodo.
But I did! have to change the authentication type in that file to http!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.