I Need Help Initializing MySQL

Anton Markov anton-F0u+EriZ6ihBDgjK7y7TUQ at public.gmane.org
Thu Mar 24 16:12:35 UTC 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen wrote:
| I have recently done a virgin install of Mandrake 10.1 and I am
| struggling to get MySQL going.
|
| I think my problem is in the GRANTS.
|
| I get errors saying I can't connect @localhost (or from any machine) and
| when I try to add passwords to user mysql, I get an error saying that
| there is no record.

MySQL makes a distinction between user@'%' and user@'localhost'.
user@'%' applies _only_ to remote users, and user@'localhost' applies
only to local users. Local user DO NOT fall under the category of "all
users" as implied by the '%' hostname.

Therefore, make sure you have a version of your user@'localhost' if you
want to connect from this machine.

|
| I tried stopping the server, and starting without it reading the grants,
| but I can't create an account.

Try this:
# killall mysqld

## Start the server without reading grant tables
# mysqld_safe --skip-grant-tables &
## Or perhaps replace 'mysqld_safe' with 'mysqld' if that doesn't work

## Get root access to the server
# mysql -u root

## You can now change users (through the mysql client):
GRANT ALL PRIVILEGES ON *.* TO root@'localhost' IDENTIFIED BY
'some_root_password';
quit


## Restart the server with grant tables
# killall mysqld

## Use whatever distribution-specific method for starting mysqld
## i.e.
# /etc/init.d/mysql start
## or if all else fails
# mysqld_safe &

## Now connect as root
# mysql -u root -p
## Enter your password at the prompt

You can now use the GRANT and REVOKE commands to add/remove/change users
and permissions. Remember, you can also manipulate the 'user', 'db',
'tables_priv', 'columns_priv', etc. tables in the the 'mysql' database
to change/add users and permissions. Just remember to do a
'FLUSH PRIVILEGES' command after.

|
| I am floundering, and the documentation is very confusing to me.

Ya, the documentation is not written with new users in mind. The entire
MySQL manual is more of a referrence guide than a manual.

|
| I expect an expert could fix this in a couple of minutes.
|
| Would anyone be available for a (hopefully short) time this weekend, and
| be willing to help? I have SSH working so this can be done remotely.

I could try to help, but I would rather do it on the mailing list so
others can learn from the solution.

I am not sure if I completely understood your problem; I got that you
can't even connect to the MySQL server at all as root. I hope the above
steps help fix that, and if I misunderstoon the problem or you need
further assistance, just reply to the list and someone will try to help.

- --
Anton Markov <("anton" + "@" + "truxtar" + "." + "com")>

GnuPG Key fingerprint =
5546 A6E2 1FFB 9BB8 15C3  CE34 46B7 8D93 3AD1 44B4

*** LINUX - MAY THE SOURCE BE WITH YOU! ***
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCQubxRreNkzrRRLQRAl26AJ4gxAXw7Bt4v1OKED7/9IpEQhHT5wCgkZk2
xFDyJM+0FdtYasg1HwyYsr0=
=7Tas
-----END PGP SIGNATURE-----
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list