Installing mysql-server doesn't create any users
Preston Hagar
prestonh at gmail.com
Thu Apr 2 20:00:01 UTC 2009
Hello all,
I am trying to install MySQL 5 server on a i386 hardy install. I have
installed MySQL previously on other Hardy machines with no problem,
but am currently running into trouble. Here is what is happening:
First, I install mysql by doing the following:
sudo apt-get install mysql-server
Things seem to go fine, it downloads the file, shows me the screen
where I can create a password for the root user, then starts the MySQL
server. I have gone through this with both entering a password and
leaving the password blank.
Once everything finishes, I try to log into the mysql server:
mysql -p mysql
I enter the password I created during install but still get
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: YES)
I tried
mysql -u root -p mysql
and get the same thing. I also tried without a password:
mysql mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: NO)
still with no luck. I also tried several different usernames (mysql,
admin) with no luck
I have tried doing
dpkg-reconfigure --force mysql-server-5.0
which brings up the enter password dialog and have tried both entering
a password and leaving it blank, neither of which seems to work. I
have tried with the mysql server running and off, as well as
restarting it after each reconfigure.
After some googling, I found that I could stop the mysql server and
start it from the command line like this:
mysqld --skip-grant-tables
This will allow me to get into the system by doing the following:
mysql -u root mysql
I can then SELECT * from user; which only returns one row with the
user debian-sys-maint From what I have found, this is some debian
specific user account and isn't meant to be used. I have tried from
here
to do:
mysql> create user 'root'@'localhost';
ERROR 1290 (HY000): The MySQL server is running with the
--skip-grant-tables option so it cannot execute this statement
but get the error you can see above. The same error occurs if I try
something like:
mysql> grant ALL PRIVILEGES ON *.* to 'root'@'localhost' with grant option;
I will be the first to admin my weakness when it comes to MySQL. I
normally favor PostgreSQL, but need MySQL for WordPress. I have spent
some time Googling trying to find another way to create a user, but am
coming up at a loss. It seems all of the command line utilities
require a valid user to create other users. I am not sure what the
password for the debian-sys-maint user is, so I don't think I can use
that. What I need is to create a user during install, like the
dpkg-reconfigure should do, but since that is obfuscated and doesn't
seem to show the command it runs, I am not sure what command I need to
run. If I can't get this working, I can always just install it from a
tarball straight from MySQL, but I would prefer to use the Ubuntu
package.
Does anyone have any suggestions of something to try or somewhere to
look? I am sure I am just missing something.
Thanks for your help.
Preston
More information about the ubuntu-users
mailing list