terça-feira, 5 de maio de 2009

Set root password for mysql

when you intall mysql server, the root user has no password associated. So, if you want to login as root user in mysql, you need to configure that.
The solution I used was:

1- start mysql with: $mysqld --skip-grant-tables

2- $mysql -U root mysql

3- $mysql> UPDATE user SET password=PASSWORD('the_pass_you_want') where USER='root';

4- $mysql> FLUSH PRIVILEGES;

5- restart mysql: /etc/init.d/mysql restart

6- access mysql: $mysql -U root -p

Sem comentários: