MySQL related issues

Source: Internet
Author: User

1. Change the password

MySQL default is no password, can be modified in the following ways:

mysql> use MySQL;

mysql> Update user Set Password=password (' new_passwd ') where name= ' name ';

mysql> flush Privileges;

Sudo/etc/init.d/mysql restart

Where new_passwd is the new password, name is the user name to be modified

2. Remote Access

Just installed MySQL should be only native login operation, in order to remote access needs to make some changes:

mysql> use MySQL;

Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' passwd ' with GRANT option;

Mysql>flush privileges;

mysql>exit;

The GRANT statement here is to give the root user all the permissions to operate the database anywhere, passwd is the password, and of course can only open a subset of the rights as needed.

But to this step may still be unsuccessful, this time check/etc/mysql/my.cnf, see if it opens bind-address = 127.0.0.1, if any, comment out this line or change to 0.0.0.0.

Then sudo/etc/init.d/mysql restart, it should be possible to access from the remote.

MySQL related issues

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.