Install MySQL and CentOS-linuxmysql in centos-Linux

Source: Internet
Author: User
Tags install perl

Install MySQL and CentOS-linuxmysql in centos-Linux

1. Install mysql

Yum (all called Yellow dog Updater, Modified) is a Shell front-end Package Manager in Fedora, RedHat, and CentOS. Based on RPM package management, You can automatically download and install the RPM package from the specified server, and automatically handle dependencies. you can install all dependent software packages at a time without the need for tedious download and installation.

Step 1: Install yum

yum install perl

Step 2: view previous versions

Step 3: Use yum to uninstall a previous version

    • Confirm deletion

Step 4: Use yum to install the server and client

Step 4-1: Create a folder mysql5.5 in/usr/local/src/java

mkdir /usr/local/src/java/mysql5.5

Step 4-2: Move the mysql package to/usr/local/src/java/mysql5.5

mv MySQL-5.5.49-1.linux2.6.i386.rpm-bundle.tar /usr/local/src/java/mysql5.5/

Step 4-3: Decompress the mysql package

tar -xvf MySQL-5.5.49-1.linux2.6.i386.rpm-bundle.tar

Step 4-4: Install the server

rpm -ivh MySQL-server-5.5.49-1.linux2.6.i386.rpm

Step 4-5: Install the client

rpm -ivh MySQL-client-5.5.49-1.linux2.6.i386.rpm

Step 5: Start the server

service mysql start

Step 6: change the password

/usr/bin/mysqladmin -u root password '123456'

 

Step 7: log on to mysql

mysql -uroot -p123456

Step 8: Create a remote Logon account

Create remote user and password

 create user 'telnet'@'%' identified by '123456';

Grant this user permission

grant all on *.* to 'root'@'%' with grant option;

Refresh permission

flush privileges;

Step 8: Modify the firewall configuration file and allow port 3306

8-1: edit the firewall configuration file

vim /etc/sysconfig/iptables

8-2: Add configuration content

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

8-3: restart the Firewall

service iptables reload

Step 9: restart the mysql server

Disable the server:

service mysql stop

Start the server

service mysql start

 

Step 10: test the remote connection data

Use other computers to remotely log on to the database. Take Navicat Premium as an example. For example, enter the relevant information and click test connection. If the connection is successful, the entire installation process is completed.

 

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.