|
|
|
|
| |
If you leave the anonymous user accounts in place, remember that the local anonymous user has the same privileges as root on Windows, which may be more access than you care to allow. To weaken that account to the same strength as the one for the remote anonymous user, revoke its superuser privileges by connecting to the server as root and issuing these statements:
mysql> REVOKE ALL ON *.* FROM ''@'localhost';
mysql> REVOKE GRANT OPTION ON *.* FROM ''@'localhost';
Another option for dealing with this account is to assign it a password; for example:
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('anonpass');
An implication of leaving the anonymous users in place is that they result in the curious phenomenon described in the "A Privilege Puzzle" section in Chapter 12. But you can read that section another time, after you have read the more general background material later in this chapter that describes how to set up new accounts.
Setting Up Passwords for a Second Server
The preceding instructions assume that you want to establish passwords on a system that hasn't had MySQL installed on it before. However, if MySQL is already installed in one location and you're setting the passwords for a new server installed in a second location on the same machine, you may find that when you attempt to connect to the new server without a password, it rejects the attempt with the following error:
% mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
Hm! Why did the server say it received a password when you didn't specify one? What this usually indicates is that you have an option file set up that lists the password for accessing the previously installed server. mysql finds the option file and automatically uses the password listed there. To override that and explicitly specify "no password," use a -p option and press Enter when mysql prompts for the password:
% mysql -p -u root
Enter password: just press Enter
You can use this strategy for mysqladmin and for other MySQL programs as well.
Additional discussion on using several servers can be found in the "Running Multiple Servers" section later in this chapter.
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|