Friday, April 09, 2004

MySQL setup


Getting MySQL set up on my laptop - I have had trouble getting root working as a "superuser"... if you're starting with a fresh/vanilla install of MySQL, the trick seems to be as follows (thanks to this page for the info) -

1. login as root: mysql -u root -h
2. grant all privileges on *.* to new_user_name@"%" identified by
'new_user_password' with grant option; // this is where you define a new user which will be superuser
3. flush privileges;
4. use mysql; //switch to the mysql database
5. delete from user where user='root';
6. flush privileges;

Now logout and login with the new user you just created - it should be able to do everything...

Labels: