MySQL configuration in Debian

Source: Internet
Author: User
MySQL configuration in Debian

1. Modify the MySQL password

Because MySQL does not have a password by default, you must modify your password for security reasons!
Let's see if your MySQL has no password:

$ Mysqladmin version


If you can see the mysql version information, it proves that MySQL currently has no password.
Run mysqladmin password xxxxxx to change the password:

# Mysqladmin password xxxxxx

Here, xxxxxx is your new password.
Now you need to run mysqladmin version -- user = root -- pass, and then enter the password to view the version number and other information.
Note: The -- user = root -- pass part in the preceding command can be abbreviated as-u root-P. Let's test whether the password has taken effect:

# Mysqladmin version-u root-P
Enter password:

2 open port 3306 listener

This work should be careful. In security considerations, by default, Debian closes port 3306. Because many hackers use it to attack your system. If you do not use other machines to access the database, do not open this port.
Modify/etc/MySQL/My. CNF and find:

Skip-networking

Comment it out:

# Skip-networking

3. Modify the default Character Set
  
Let MySQL use simplified Chinese as the default character set. Edit/etc/init. d/MySQL and find this line:

/Usr/bin/safe_mysqld>/dev/null 2> & 1 &

Changed:

/Usr/bin/safe_mysqld> -- default-character-set = gb2312>/dev/null 2> & 1 &

OK. Restart MYSQL:

#/Etc/init. d/MySQL restart


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.