The security of the database system includes many aspects. Because in many cases, the database server allows clients to connect from the network, the security of client connections has a significant impact on MySQL database security.
Do not provide a password on the client's command line
When using a client to connect to a MySQL server with MySQL, mysqladmin, and so on, you need to provide a password for the connection.
1 You can provide a password on the command line
Shell>mysql–u Root–pmypass
Note that there is no space between the-p option and the password, or you will be prompted to enter the password, and error.
You can also use the long format
Shell>mysql–user=root–password=mypass
Now you can examine the consequences of doing this:
On Unix, $ps –aux | grep MySQL
On the Win9x, you can hold down the Ctrl+alt+del key, NT you can open Task Manager.
What you find, you find that the password is clearly displayed in front of you. So don't do it anytime.
So you need to have the client prompt for your password:
Shell>mysql–u root–p
You can also use the option file to provide a password, but note that in order to be secure, you cannot store the password in the options file. You can only provide the password option, let the client prompt you to enter the password.
Using SSH to encrypt client connections
This is a note about how to use SSH to get a secure connection to a remote MySQL server (David Carlson).
Install SSH clients on your Windows machine-I use a free SSH client from http://www.doc.ic.ac.uk/~ci2/ssh/. Other Useful Links:
Http://www.npaci.edu/Security/npaci_security_software.html
Http://www.npaci.edu/Security/samples/ssh32_windows/index.html.
Start SSH. Set host name = your MySQL server name or IP address, set userid= your username to login to your server.
Click on "Local Forwords". Set local port:3306, host:localhost, remote port:3306
Save everything, or you'll have to do it again next time.