Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Root user for MySQL after creation

Status
Not open for further replies.
Aug 31, 2009
4
NZ
We have recently installed MySQL 5.0.51 on Debian Linux. It seems something went wrong in the set up because there is no root user. I logged in in safe mode and the only user there is 'debian-sys-maint'. I am not prepared (at this stage) to change the password etc of this user until I can be sure that this is supposed to be root. If not, could someone please tell me the qury details I would need to create root user and grant privileges etc.
 
I believe you are confusing the Database user with the Linux Os user.

Have you tried connecting to MYSQL with any DB manager and using the ROOT user?

You can also use the command line to connect to MYSQL.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I have tried to login to MYSQL via webmin and via the command line. If i try 'root' I can't get in at all. I logged in to MySQL in safe mode using the 'mysqld_safe --skip-grant-tables &' command, and ran the query SELECT user, PASSWORD from user. The only user that was returned from the user table was 'debian-sys-maint'. That sort of implies that there is no 'root' user doesn't it?
I can log in to MYSQL via the command line as user 'debian-sys-maint' leaving the password blank.
SO My question is, if debian-sys-maint is not the same as 'root', how do I create the 'root' user with the correct permissions
 
Ahh sorry about that,

Well, You can always try the

Code:
CREATE USER 'root'@'localhost' IDENTIFIED BY 'some_pass';
command, and then grant everything to the user
Code:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks for your help so far. I have got a little further with this I used the command:
sudo dpkg-reconfigure mysql-server-5.0

This allowed me to set the root password. I can now get in to MySQL from webmin and log in to MYSQL as root.

This however has not given me permissions to do anything at all except to view the information schema. How do I then become a user that can create databases and view permissions etc?

Sorry to be such a pain, but I am sure once I get this figured out I will be away laughing
 
Try Granting all privileges to your ROOT user now.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks - you are a star. As I had to log in in safe mode, I couldn't use GRANT - BUT I was able to use SQL to Create a user 'root' with all the permissions (took a while) but now everything works. Couldn't have done it without your input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top