79438

79438



Assigning root Account Passwords

The root account passwords can be set several ways. The following

discussion demonstrates three

methods:

•    Use the set password statement

•    Use the UPDATE statement

•    Use the mysąladmin command-line Client program

To assign passwords using set password, connect to the server as root and issue a set

PASSWORD statement for each root account listed in the mysąl .user

table. Be surę to encrypt the

password using the password () [1283] function.

For Windows, do this:

shell>raysql -u root

mysql>SET PASSWORD FOR 'root'0'localhost• = PASSWORD ('ne*pwd') ; mysql>SET PASSWORD FOR ' root' 0 • 127.0.0.1 • = PASSWORD (' newpurd') ; mysql>SET PASSWORD FOR ’root'@’::1• = PASSWORD('newpwd’); mysql>SET PASSWORD FOR 1root' 0 ' % ' = PASSWORD('newpwd');

The last statement is unnecessary if the mysąl .user table has no root account with a host value of

%.

For Unix, do this:

Shell>icysql -u root

mysql>SET PASSWORD FOR ’root'0'localhost' = PASSWORD ('newpwd') ; mysql>SET PASSWORD FOR 'root'0'127.0.0.1' = PASSWORD('newpwd'); mysql>SET PASSWORD FOR 'root'0' : :1' = PASSWORD (' newpwd' ) ; mysql>SET PASSWORD FOR 'root'0'host_name' = PASSWORD('newpwd');

You can also use a single statement that assigns a password to all root accounts by using UPDATE to

modify the mysąl .user table directly. This method works on any platform:

shell>raysql -u root

mysql>UPDATE raysql.user SET Password = PASSWORD('newpwd')

-■WHERE User = 'root'; mysql>FLUSH PRIVILEGES;

The flush statement causes the server to reread the grant tables.

Without it, the password change

remains unnoticed by the server until you restart it.



Wyszukiwarka

Podobne podstrony:
Setting Environment Variables Environment variables can be set at the command prompt to affect the c
4798 5 CASIOOperation Guide 4798 Timekeeping •    The year can be set in the rangę ot
Assigning Anonymous Account Passwords The mysql commands in the following instructions include a -p
If you want 10 credits of introductory management accounting modules, the following alternatives are
Administrator Guidelines for Password Security Database administrators should use the following guid
Limitations of Online DDL Take the following considerations into account when creating or dropping I
SYS and SYSTEM Users The following administrative user accounts are automatically created when you i
SQL nodes. On each of the machines designated to host SQL nodes, perform the following steps as the
image125 (5) w User Account ControlDo you want to allow the following program to update software on
Free will Free will. Agents have the abttty to make cho*ces. Indrv>duals can be hełd morally acco
register form Username A password will be e-mailed to you. Register
File Edit Options View Tools Extensions HelpClBBiSLogical [Root] New Cluster Move Object Set Tiled
INFOST XXX Page 4 of 7 ASSIGNMENTS: Assignments are due on the specified datę (midnight CST on the d

więcej podobnych podstron