When you connect to the MySQL server, you should use a password. The password is not transmitted in plain text. The password processing in the Client Connection sequence has been upgraded in MySQL 4.1.1, which is safe. If you are still using a pre-4.1.1-style password, the encryption algorithm is not as strong as the new algorithm; by some work, smart attackers who can steal communications between the client and the server can crack the password. If the connection between the client and the server passes through an untrusted network, you should use an SSH tunnel to encrypt the communication.
Other information is transmitted in text and can be read by anyone who can see the connection. If you are worried about this, you can use the compression Protocol to make communication more difficult to decrypt. To make the connection more secure, you should use SSH to obtain the TCP/IP connection between the encrypted MySQL server and the MySQL client. (Note: You can also use OpenSSL support in MySQL .)
To ensure MySQL system security, we strongly recommend that you consider the following suggestions:
Use the password for all MySQL users. The client program does not need to know the identity of the person who runs it. For client/server applications, you can specify the user name of the client program. For example, if other_user does not have a password, anyone can simply use mysql-u other_user db_name to impersonate someone else to call the mysql program for connection. If all users have passwords, it is much more difficult to connect to other users' accounts.
To change the user PASSWORD, use the set password statement. You can also directly update the user table in the mysql database. For example, you need to change the password of all root users for the MySQL account.
Shell> mysql-u root
Mysql> UPDATE mysql. user SET Password = PASSWORD ('newpwd ')
-> WHERE User = 'root ';
Mysql> flush privileges;
Never run the MySQL server as a Unix root user. This operation is very dangerous because any user with FILE Permission can use root to create files (for example ,~ Root/. bashrc ). To prevent mysqld from running with root, unless explicitly specified using the -- user = root option.