After mysql 4.1.18 is installed on FREEBSD, myeclips MyEclipse Database Explorer is installed on another XP machine, and MyEclipse Database Explorer is used to access the mysql Database, result After the user name and password are set up, but cannot connect, of course, before this must first download mysql jdbc (mysql-connector-java-3.2.0-alpha-bin), each time the error message is host 10.33.250.101 can not connect to the mysql database. After checking the mysql information, we found that the user needs to be authorized.
The solution is as follows:
Format: grant select on database. * to username @ login host identified by "password"
Example 1: Add a user user_1 with a password of 123 so that he can log on to any host and have the permission to query, insert, modify, and delete all databases. First, use the root user to connect to MySQL, and then type the following command:
Mysql> grant select, insert, update, delete on *. * to user_1 @ "%" Identified by "123 ";
In example 1, the added user is very dangerous. If you know the user_1 password, then he can log on to your MySQL database on any computer on the Internet and do whatever he wants. For the solution, see Example 2.
Example 2: Add a user_2 password of 123 so that the user can only log on to localhost, you can also query, insert, modify, and delete the database aaa (localhost refers to the local host, that is, the host where the MySQL database is located), so that the user knows the password of user_2, he cannot directly access the database from the Internet, and can only operate the aaa database through the MYSQL host.
Mysql> grant select, insert, update, delete on aaa. * to user_2 @ localhost identified by "123 ";
If a new user cannot log on to MySQL, run the following command during logon:
Mysql-u user_1-p-h 192.168.113.50 (-H is followed by the IP address of the host to be logged on)