Install MySQL 5.5 with Yum (for centos6.2/5.8 and Fedora 17/16 platforms)

Source: Internet
Author: User
Tags iptables

Currently centos/red Hat (RHEL) 6.2 officially comes with the MySQL version for 5.1,mysql5.5 has come out.

The improvements are not only made in several ways compared to mysql5.1,mysql5.5:

    • The performance has improved a lot.
    • Change the default storage engine to InnoDB
    • CPU multi-core processing performance improvement
    • Enhanced replication, new semi-synchronous replication
    • Enhanced table partitioning Capabilities
    • Wait a minute
This article will guide you on how to install the latest version of the community version of MySQL under centos/red Hat (RHEL) 6.2 and Fedora 17/16. If you are upgrading MySQL, please back up your data and configuration files before upgrading. Installing MySQL 5.5 in centos/red Hat (RHEL) 6.2/5.8 and Fedora 17/16 let's get started. Step1. Switch to root user [Plain]View Plaincopy
    1. Su-
    2. # # OR # #
    3. Sudo-i
Step2. Installing the Remi Software source Fedora Platform [Plain]View Plaincopy
  1. # # Remi Dependency on Fedora 17, 16, 15
  2. RPM-UVH http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
  3. RPM-UVH http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
  4. # # Fedora 17 # #
  5. RPM-UVH http://rpms.famillecollet.com/remi-release-17.rpm
  6. # # Fedora 16 # #
  7. RPM-UVH http://rpms.famillecollet.com/remi-release-16.rpm
  8. # # Fedora 15 # #
  9. RPM-UVH http://rpms.famillecollet.com/remi-release-15.rpm
  10. # # Fedora 14 # #
  11. RPM-UVH http://rpms.famillecollet.com/remi-release-14.rpm
  12. # # Fedora 13 # #
  13. RPM-UVH http://rpms.famillecollet.com/remi-release-13.rpm
  14. # # Fedora 12 # #
  15. RPM-UVH http://rpms.famillecollet.com/remi-release-12.rpm


CentOS and Red Hat (RHEL) platforms [Plain]View Plaincopy
  1. # # Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 # #
  2. RPM-UVH http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
  3. # # CentOS 6 and Red Hat (RHEL) 6 # #
  4. RPM-UVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  5. # # Remi Dependency on CentOS 5 and Red Hat (RHEL) 5 # #
  6. RPM-UVH http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
  7. # # CentOS 5 and Red Hat (RHEL) 5 # #
  8. RPM-UVH http://rpms.famillecollet.com/enterprise/remi-release-5.rpm


Step3. View MySQL version number Fedora 17, 16, 15, 14, 13, 12 [Plain]View Plaincopy
    1. Yum--enablerepo=remi list MySQL Mysql-server
CentOS 6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8
[Plain]View Plaincopy
    1. Yum--enablerepo=remi,remi-test list MySQL Mysql-server

Output:
[Plain]View Plaincopy
  1. Loaded Plugins:changelog, Fastestmirror, Presto, Refresh-packagekit
  2. ...
  3. Remi | 3.0 KB 00:00
  4. remi/primary_db | 106 KB 00:00
  5. Available Packages
  6. mysql.i686 5.5.25-1.fc14.remi @remi
  7. mysql-server.i686 5.5.25-1.fc14.remi


Step4. Install or upgrade to MySQL5.5.25
Fedora 17, 16, 15, 14, 13, 12 [Plain]View Plaincopy
    1. Yum--enablerepo=remi install MySQL Mysql-server
CentOS 6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8
[Plain]View Plaincopy
    1. Yum--enablerepo=remi,remi-test install MySQL Mysql-server
Step5. Turn on the MySQL service and configure the self-boot
Fedora 17/16 [Plain]View Plaincopy
    1. Systemctl Start Mysqld.service
    2. Systemctl Enable Mysqld.service

Fedora 15/14/13/12/11, CentOS 6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8 [Plain]View Plaincopy
    1. /etc/init.d/mysqld start
    2. # # OR # #
    3. Service mysqld Start
    4. Chkconfig--levels 235 mysqld on
Step6. MySQL Security Settings
    • Set (Modify) root password
    • Delete anonymous user
    • Disable root Telnet
    • Delete Test Database Tests
    • Overloaded Permissions Table
To enable MySQL security settings, enter the following command
[Plain]View Plaincopy
    1. /usr/bin/mysql_secure_installation
Output [Plain]View Plaincopy
  1. Note:running all PARTS of this SCRIPT are RECOMMENDED for all MySQL
  2. SERVERS in PRODUCTION use! Please READ each STEP carefully!
  3. In order-to-log into MySQL-secure it, we\ ' ll need the current
  4. Password for the root user. If you\ ' ve just installed MySQL, and
  5. You haven\ ' t set the root password yet, the password would be blank,
  6. So, should just press ENTER here.
  7. Enter current password to root (enter for none):
  8. OK, successfully used password, moving on ...
  9. Setting The root password ensures that nobody can log into the MySQL
  10. Root user without the proper authorisation.
  11. Set root Password? [y/n] Y
  12. New Password:
  13. Re-enter new password:
  14. Password Updated successfully!
  15. Reloading privilege tables.
  16. ... success!
  17. By default, a MySQL installation have an anonymous user, allowing anyone
  18. To log into MySQL without has to has a user account created for
  19. them. This was intended only for testing, and the installation
  20. Go a bit smoother. You should remove them before moving into a
  21. Production environment.
  22. Remove anonymous users? [y/n] Y
  23. ... success!
  24. Normally, Root should only is allowed to connect from ' localhost '. This
  25. Ensures that someone cannot guess at the root of password from the network.
  26. Disallow Root login remotely? [y/n] Y
  27. ... success!
  28. By default, MySQL comes with a database named ' test ' that anyone can
  29. Access. This was also intended only for testing, and should be removed
  30. Before moving into a production environment.
  31. Remove test database and access to it? [y/n] Y
  32. -Dropping test database ...
  33. ... success!
  34. -Removing privileges on test database ...
  35. ... success!
  36. Reloading the privilege tables would ensure that all changes made so far
  37. would take effect immediately.
  38. Reload privilege tables now? [y/n] Y
  39. ... success!
  40. Cleaning up ...
  41. All done! If you\ ' ve completed all of the above steps, your MySQL
  42. Installation should now is secure.
  43. Thanks for using mysql!


Note: If you do not want to start the MySQL security Settings command, but at least you have to change the root user password [Plain]View Plaincopy
    1. mysqladmin-u root password [your_password_here]
    2. # # example # #
    3. Mysqladmin-u Root Password Myownsecrectpass

Step7. Connect a local database with a password

[Plain]View Plaincopy
    1. Mysql-u root-p
    2. # # OR # #
    3. Mysql-h Localhost-u Root-p

Step8. Specifies the user configuration for the specified database, specifying client (IP) remote access

The configuration parameters for this example are as follows
[Plain]View Plaincopy
    1. Db_name = WebDB
    2. user_name = Webdb_user
    3. REMOTE_IP = 10.0.15.25
    4. PASSWORD = password123
    5. PERMISSIONS = All
1. Create a database WebDB
[Plain]View Plaincopy
    1. mysql> CREATE DATABASE webdb;

2. Create User Webdb_user
[Plain]View Plaincopy
    1. mysql> CREATE USER ' webdb_user ' @ ' 10.0.15.25 ' identified by ' password123 ';

3. Authorization
[Plain]View Plaincopy
    1. Mysql> GRANT all on webdb.* to [email protected] ' 10.0.15.25 ';

4. Overloaded Permissions Table
[Plain]View Plaincopy
    1. mysql> FLUSH privileges;
Step9. Configure the firewall to turn on 3306 Port 1. To modify the/etc/sysconfig/iptables file:
[Plain]View Plaincopy
    1. Vi/etc/sysconfig/iptables
2. Add the following before commit:
[Plain]View Plaincopy
    1. -A input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT
3. Restart Iptables:
[Plain]View Plaincopy
    1. Service Iptables Restart
    2. # # OR # #
    3. /etc/init.d/iptables restart
4. Test the remote Access database on the client computer:
[Plain]View Plaincopy
    1. Mysql-h dbserver_name_or_ip_address-u webdb_user-p WebDB


********************************************
* Ye Wentao
* Link: Install MySQL 5.5* source in centos/red Hat (RHEL) 6.2/5.8 and Fedora 17/16: Install MySQL 5.5.25 on Fedora 17/16, centos/red Hat (RH EL) 6.2/5.8
Reprint please indicate source ***************

Install MySQL 5.5 with Yum (for centos6.2/5.8 and Fedora 17/16 platforms)

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.