Install and maintain MySQL5.6 in RedHat

Source: Internet
Author: User
Environment: Prepare MySQL-client-5.6.2_m5-1.rhel5.i386.rpmMySQL-devel-5.6.2_m5-1.rhel5

Prepare the environment:

RedHat 5 system, MySQL 5.6 rpm package

First, upload mysql to the server.

1. Decompress MySql

[Root@www.linuxidc.com] # tar-xvf MySQL-5.6.2_m5-1.rhel5.i386.tar

MySQL-client-5.6.2_m5-1.rhel5.i386.rpm

MySQL-devel-5.6.2_m5-1.rhel5.i386.rpm

MySQL-embedded-5.6.2_m5-1.rhel5.i386.rpm

MySQL-server-5.6.2_m5-1.rhel5.i386.rpm

MySQL-shared-5.6.2_m5-1.rhel5.i386.rpm

MySQL-test-5.6.2_m5-1.rhel5.i386.rpm

2. Install the MySQL-server package

[Root@www.linuxidc.com] # rpm-ivh MySQL-server-5.6.2_m5-1.rhel5.i386.rpm

Error: Failed dependencies:

MySQL conflicts with mysql-5.0.45-7.el5.i386

MySQL-serverconflicts with mysql-server-5.0.45-7.el5.i386

(Installation failed. because the system has previously installed mysql, uninstall it! Re-install)

[Root@www.linuxidc.com] # rpm-e mysql-5.0.45-7.el5.i386 -- nodeps

[Root@www.linuxidc.com] # rpm-e mysql-server-5.0.45-7.el5.i386-nodeps

[Root@www.linuxidc.com] # rpm-ivh MySQL-server-5.6.2_m5-1.rhel5.i386.rpm

Preparing... ######################################## ### [100%]

1: mySQL-server ##################################### ###### [100%]

[Root@www.linuxidc.com] # rpm-ivh MySQL-client-5.6.2_m5-1.rhel5.i386.rpm

Preparing... ######################################## ### [100%]

1: mySQL-client ##################################### ###### [100%]

 

3. Start mysql and set the logon Password

[Root@www.linuxidc.com] #/etc/init. d/mysql start

StartingMySQL... [OK]

[Root @ shiyue5 u01] # mysqladmin-u rootpassword "123456"

4. log on to mysql and create a database

[Root @ shiyue5 ~] # Mysql-u root-p

Enterpassword:

Welcometo the MySQL monitor. Commands end with; or \ g.

YourMySQL connection id is 5

Serverversion: 5.6.2-m5 MySQL Community Server (GPL)

 

Copyright (c) 2000,201 0, Oracle and/or its affiliates. All rights reserved.

 

Oracleis a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

 

Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

 

Mysql> create database shiyue;

QueryOK, 1 row affected( 0.01 sec)

5. Configure Client Connection

Mysql> use mysql;

Readingtable information for completion of table and column names

Youcan turn off this feature to get a quicker startup with-

 

Database changed

Mysql> grant all on *. * to root @ "%" identified by "123456 ";

QueryOK, 0 rows affected( 0.00 sec)

 


Query the 1042 issue code to obtain the/etc/my. cnf file, and add a line of skip-name-resolve in [mysqld ].

If my is not in the/etc/directory. for the cnf configuration file, go to/usr/share/mysql/and find *. cnf file, copy one of them to/etc/and change it to my. cnf

[Root @ shiyue5 ~] # Cp/usr/share/mysql/my-medium.cnf/etc/my. cnf

[Root @ shiyue5 ~] # Vi/etc/my. cnf

 

# Example MySQL config file for medium systems.

#

# Thisis for a system with little memory (32 M-64 M) where MySQL plays

# Animportant part, or systems up to 128 M where MySQL is used together

# Other programs (such as a web server)

#

# MySQL programs look for option files in a set

# Locations which depend on the deployment platform.

# Youcan copy this option file to one of those

# Locations. For information about these locations, see:

# Http://dev.mysql.com/doc/mysql/en/option-files.html

#

# Inthis file, you can use all long options that a program supports.

# Ifyou want to know which options a program supports, run the program

# Withthe "-- help" option.

 

# Thefollowing options will be passed to all MySQL clients

[Client]

# Password = your_password

Port = 3306

Socket =/var/lib/mysql. sock

 

# Herefollows entries for some specific programs

 

# TheMySQL server

[Mysqld]

Port = 3306

Socket =/var/lib/mysql. sock

Skip-external-locking

Key_buffer_size = 16 M

Max_allowed_packet = 1 M

Table_open_cache = 64

Sort_buffer_size = 512 K

Net_buffer_length = 8 K

Read_buffer_size = 256 K

Read_rnd_buffer_size = 512 K

Myisam_sort_buffer_size = 8 M

Skip-name-resolve

 

# Don't listen on a TCP/IP port at all. This can be a security enhancement,

# Ifall processes that need to connect to mysqld run on the same host.

# Allinteraction with mysqld must be made via Unix sockets or named pipes.

"/Etc/my. cnf" 145L, 4700C written

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.