MySQL installation under Debian

Source: Internet
Author: User
To install MySQL under Debian, proceed as follows:

Debian:/# apt-get Install Mysql-server

After the installation, the default root is no password and can be changed.

Debian:/# mysqladmin-u root password $ (yourpass)

You can modify some properties in/etc/mysql/my.conf.

It turns out that there is a line: Bind-address = 127.0.0.1

This means that only the machine can access it, and is willing to keep the data safe. Now you want to enable remote machines to access the MySQL database service, you can change the bind-address to achieve, two ways:

1. bind-address = 0.0.0.0

2. Comment out the bind-address line directly

When this is done, execute the following command:

/etc/init.d/mysql stop
/etc/init.d/mysql start

Some say/etc/init/d/mysql reload, but sometimes it seems to be a strange problem, with the above two steps better. Ossim official website said changed to Bind-address = *, I tried, not work, waste me a lot of time.

After these steps are done, remote machine access is also granted:

MySQL > GRANT all on * * to ' root ' @ '% ' identified by ' Root_password ' with GRANT OPTION;

The above command means that a computer with a root account and password (root_password) is allowed to access the MySQL Server for any IP address (% is a wildcard character).

That's good.

MySQL installation under Debian

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.