Does anyone know the command to set the password for the root user (new install) and start the server?
Printable View
Does anyone know the command to set the password for the root user (new install) and start the server?
Hi ac1dsp3ctrum,
Which version of MySQL are you using? Windows or Linux?
If you're using for windows you can set the root/administrator password after installation by going to the directory / folder where you have installed MySQL.
Proceed to the bin folder and double-click winmysqladmin.exe it will ask you for the username and password of the administrator, and it will automatically load MySQL afterwards.
Hope this helps.
hope this helps as well:
http://www.mysql.com/doc/D/e/Default_privileges.html
cheers,
http://www.codebits.com/bit.cfm?BitID=120
http://www.mysql.com/doc/D/e/Default_privileges.html gives you....
Hope something there helps....Quote:
shell> mysql -u root mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password');
from install :
You should also add a password for the `root' user. The following
example starts by removing the anonymous user that can be used by anyone
to access the `test' database, then sets a `root' user password:
C:\> C:\mysql\bin\mysql mysql
mysql> DELETE FROM user WHERE Host='localhost' AND User='';
mysql> QUIT
C:\> C:\mysql\bin\mysqladmin reload
C:\> C:\mysql\bin\mysqladmin -u root password your_password
After you've set the password, if you want to take down the `mysqld'
server, you can do so using this command:
C:\> mysqladmin --user=root --password=your_password shutdown
* Use passwords for all MySQL users. Remember that anyone can log in
as any other person as simply as `mysql -u other_user db_name' if
`other_user' has no password. It is common behavior with
client/server applications that the client may specify any user
name. You can change the password of all users by editing the
`mysql_install_db' script before you run it, or only the password
for the MySQL `root' user like this:
shell> mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password')
WHERE user='root';
mysql> FLUSH PRIVILEGES;
Because your installation is initially wide open, one of the first
things you should do is specify a password for the MySQL `root' user.
You can do this as follows (note that you specify the password using
the `PASSWORD()' function):
shell> mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password')
WHERE user='root';
mysql> FLUSH PRIVILEGES;
Neb
Attached is Install file (compressed)