MySQL set initial password and allow remote access

Source: Internet
Author: User
Tags iptables

I. MySQL Modify set initial password

    1. After installing MySQL, log in to the GUI using the MySQL command:

650) this.width=650; "title=" 1.png "src=" Http://s2.51cto.com/wyfs02/M02/7C/F0/wKiom1bc6_XAJtq9AAAvoZI-b40759.png " alt= "Wkiom1bc6_xajtq9aaavozi-b40759.png"/>

2. Modify the user password inside the database.

mysql> use MySQL

mysql> Update user Set Password=password ("Huaxia") where user= ' root ';

mysql> flush Privileges;

Mysql> exit

650) this.width=650; "title=" 2.png "src=" Http://s5.51cto.com/wyfs02/M01/7C/F0/wKiom1bc7ROy_UaPAAAoL5AgrCo398.png " alt= "Wkiom1bc7roy_uapaaaol5agrco398.png"/>

3. Log in to MySQL using a password-modified root user

Mysql-uroot-p

650) this.width=650; "title=" 3.png "src=" Http://s5.51cto.com/wyfs02/M00/7C/EF/wKioL1bc7d7QkeafAAAzKgG4Sbg004.png " alt= "Wkiol1bc7d7qkeafaaazkgg4sbg004.png"/>

Two. mysql Settings telnet

In the MYSQ login database interface, enter the command

GRANT all privileges on * * to ' root ' @ '% ' identified by ' Huaxia ' with GRANT OPTION;

(' root ' indicates the logged-in user, '% ' means all computers can be connected, can also set an IP address to run the connection, ' Huaxia '

Represents a password).

then execute flush privileges; command Refresh execution

650) this.width=650; "title=" 4.png "src=" Http://s2.51cto.com/wyfs02/M00/7C/EF/wKioL1bc87OjeefDAAAeCPpJLUE620.png " alt= "Wkiol1bc87ojeefdaaaecppjlue620.png"/>

Three. Connect using the connection tool such as Navicat

Remember to shut down the database's host firewall or to release the default 3306 port on the external network.

Service Iptables Stop

Chkconfig iptables off

Connect using Navicat

650) this.width=650; "title=" 5.png "src=" Http://s1.51cto.com/wyfs02/M00/7C/F1/wKiom1bc8__xhDEbAABsS-n1YYw750.png " alt= "Wkiom1bc8__xhdebaabss-n1yyw750.png"/>

Connection test

650) this.width=650; "title=" 6.png "src=" Http://s3.51cto.com/wyfs02/M01/7C/EF/wKioL1bc9LPDyvpKAACYWb_Swso589.png " alt= "Wkiol1bc9lpdyvpkaacywb_swso589.png"/>

You can open the database.

650) this.width=650; "title=" 7.png "src=" Http://s4.51cto.com/wyfs02/M02/7C/F1/wKiom1bc9KKQujziAAAij2pU7o4504.png " alt= "Wkiom1bc9kkqujziaaaij2pu7o4504.png"/>



This article is from the Server Software upgrade blog, so be sure to keep this source http://shamereedwine.blog.51cto.com/5476890/1748314

MySQL set initial password and allow remote access

Related Article

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.