CentOS 6.x installation MySQL

Source: Internet
Author: User

Before installing, you should check whether the system is comfortable with MySQL software package

Rpm-qa|grep-i MySQL

#如果有的话需要先删除 rpm-e software name--nodeps

#To See all files in an RPM package (for example, a mysql-server rpm), run a command like this:

RPM-QPL mysql-server-version.linux_glibc2.5.i386.rpm

#To perform a standard minimal installation, install the server and client RPMs:

RPM-IVH mysql-server-version.linux_glibc2.5.i386.rpm

RPM-IVH mysql-client-version.linux_glibc2.5.i386.rpm


#安装后生成的一个随机密码在/root/.mysql_secret

#启动 MySQL

Service MySQL Start

#登录mysql

Mysql-u root-p

#修改密码

SET Password=password (' PASSWORD ');

#添加一个可远程登录的帐号

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

FLUSH privileges;

#修改密码

SET PASSWORD for ' root ' @ '% ' = PASSWORD (' PASSWORD ');


Allow Port 3306

Iptables-i input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT

# See if the rules are in effect

Iptables-l-N # or: Service iptables status

# The production environment is not secure at this time, the port should be closed after remote management, and the previously added rules should be removed

iptables-d input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT

PS, above iptables Add/Remove rules are temporary, if you need to restart after the effective, you need to save the changes:

Service Iptables Save # or:/etc/init.d/iptables save

Other than that

Vi/etc/sysconfig/iptables # plus the following line of rules is OK

-A input-p tcp-m state--state new-m TCP--dport 3306-j ACCEPT

Remote management of the database software, win system can use SQLyog, with several remote software, feel this use is pretty good.


CentOS 6.x installation MySQL

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.