Experience in MySQL Security Settings

Source: Internet
Author: User

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.

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.