mysql--Installing Linux (Version 5.6)

Source: Internet
Author: User

Version 1

Currently MySQL database is divided into Community Edition (Community Server) and Enterprise Edition (enterprise/commercial) by user group. --commercial Authorized Version

The Community edition is free to download and the Enterprise Edition is paid for and cannot be downloaded online.

The Community edition is divided into 3 categories:

GA (General availability): The officially recommended version (this article uses the version).

RC (Release Candidate): Candidate version, this version is close to the official version.

Both Alpha and Bean are beta versions, and Alpha is a beta version. The bean is a public beta version.

2 Media

Official website: www.mysql.com/

MYSQL-DEVEL-5.6.13-1.EL6.X86_64.RPM Database Dependency Package

MYSQL-CLIENT-5.6.13-1.EL6.X86_64.RPM Database Client

MYSQL-SERVER-5.6.13-1.EL6.X86_64.RPM Database Server

The downloaded file can be uploaded to the/tmp/path for backup

1 Installation 1.1 checking the installation status and version information 1.1.1 RPM format installation mysql uninstall mode

Rpm-qa|grep-i MySQL

The system has already installed MySQL database, version 5.1.47 (e.g.)

Uninstall MySQL-related packages based on query results

For example, for mysql-5.1.47-4.el6.x86_64 this package, the Unload command is

Rpm-e Mysql-5.1.47-4.el6.x86_64–nodeps

Description: The-e parameter indicates that deleting –nodeps indicates that the dependency is not verified

The main uninstall content typically includes the following packages

Mysql-5.1.47-4.el6.x86_64

Mysql-connector-odbc-5.1.5r1144-7.el6.x86_64

Mysql-libs-5.1.47-4.el6.x86_64

Mysql-devel-5.1.47-4.el6.x86_64

Mysql-server-5.1.47-4.el6.x86_64

Uninstall commands such as

1.1.2 Binary package format installed MySQL Uninstall

If MySQL is installed in the binary package format, then the Rpm–qa|grep mysql command is not found at all, and needs to be uninstalled as follows

First stop the MySQL service and view the running status as

Service MySQL Stop

Service MySQL Status

Next, find all the msyql files for deletion (except for the red box, if none are removed)

Find/-name MySQL

May be reported

Without a tube, proceed down to execution.

Then, according to the query results to execute the delete command, the red Word is the above query results, other similar

Rm-rf/etc/rc.d/init.d/mysql

Finally, view and delete MySQL users

ID mysql (view mysql user)

Userdel MySQL (delete mysql user)

Also, delete the configuration files that may exist

Rm-f/etc/my.cnf

Rm-f/usr/my.cnf

The uninstallation is complete.

1.2 Installing the Client

RPM-IVH mysql-client-5.6.13-1.el6.x86_64.rpm

1.3 Installing the server side

RPM-IVH mysql-server-5.6.13-1.el6.x86_64.rpm

You may experience the following 2 issues when installing the server side in CentOS 7.0

Question 1:

The reason is that the system has installed other versions of the Mysql-libs package resulting in incompatibility, executing the command

Yum-y Remove Mysql-libs

Execute the Server installation command again

RPM-IVH mysql-server-5.6.13-1.el6.x86_64.rpm

Question 2:

The installation process encountered the following error

Can ' t locate data/dumper.pm in @INC (@INC contains:/USR/LOCALB64/PERL5/USR/LOCAL/PERL5

Please perform the following command under the conditions of networking

Yum Install Cpanminus

Execute the server-side installation command again

RPM-IVH mysql-server-5.6.13-1.el6.x86_64.rpm

If you are still having problems, please return to uninstalling the database and reinstalling

1.4 Directory Structure

The MySQL group, MySQL user will be created after installation. The genus group of the database directory is Mysql:mysql

Find/-name MySQL

1.5 Database Basic Operations 1.5.1 View status

Service MySQL status (view the status of the MySQL service)

Description: The status in the figure indicates that the MySQL service is not started

If you encounter the following error

error! MySQL is running but PID file could not being found

Please execute the following command

Ps-ef|grep MySQL

Execute KILL command to kill the found MySQL related process, change the red part to the current found PID

Kill-9 15602

Kill-9 15765

Execute the following command again

Ps-ef|grep MySQL

The result is as shown

1.5.2 Start

Service MySQL Start

1.5.3 Restart

Service MySQL Restart

1.5.4 Stop

Service MySQL Stop

1.1.1 Self-priming

Chkconfig--list MySQL

Note : In this example, the MySQL installation is completed after the boot [NSITD2] state, so there is no need to change.

1.1.2 Password Modification 1.1.2.1 redhat revision

After the MySQL database is started, a password is generated for the root user by default, and the command

Cat/root/.mysql_secret

You can view the password information in this case (JX5FXI3Y)

Enter the command:

mysqladmin-uroot-p password ' root ' [NSITD3]

Enter the command after the system prompts for a password (enter password), here enter myql existing password is automatically generated random password [NSITD4] (this example is jx5fxi3y)

1.1.2.2 CentOS 7 Revision

Skip the authorization table to start the MySQL server and enter the command:

Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &

Command line can not be clicked Ctrl + C, login input command:

Mysql-u Root MySQL

Change the password input (the semicolon at the end of the sentence also to enter), note that the red part is a custom password, single quotation marks do not lose

UPDATE user SET Password=password (' * * * ') where user= ' root ';

Input (the semicolon at the end of the sentence must also be entered)

FLUSH privileges;

Input (the semicolon at the end of the sentence must also be entered)

Quit

Restart MySQL service, enter

Service MySQL Restart

1.1.3 Test Login

Enter the following command (the red part is a custom password)

mysql-uroot–p****

Display as login successful

Login successful, enter quit; (The semicolon at the end of the sentence cannot be lost) quit MySQL

2 Database Configuration 2.1 configuration file

Copy the MySQL default profile to/etc directory and edit it

Cp/usr/share/mysql/my-default.cnf/etc/my.cnf

Vi/etc/my.cnf

Press the I key to enter edit mode, edit in [mysqld] paragraph (position is not wrong), add or edit content

Lower_case_table_names =1

Max_allowed_packet = 20M

Skip-name-resolve

Symbolic-links=0

Press ESC, exit edit mode, enter: Wq command to save the exit, the result is as follows:

Figure 4.1 MySQL configuration file

1.1 Login Authorization

Log in to MySQL after the command authorization root user can be in the native IP (this example MySQL server IP is 172.16.254.103) or any IP (%) login,% can be configured to specify the IP address, in order to facilitate the client connection to the MySQL database for management The following command is the MySQL command:

(The following statements may be executed in version centos7, there are workarounds below)

Grant all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT option;

Grant all privileges on * * to ' root ' @ ' 172.16.254.103 ' identified by ' root ' with GRANT option;

If the above statement is executed in version CentOS7, the following error is reported

Just enter the following command (the red part is a custom password):

SET PASSWORD = PASSWORD (' * * * * ');

mysql> flush Privileges; [NSITD1]

Mysql> quit;

Description:% represents any reachable MySQL database server client IP that can be modified to the specified client IP according to the actual situation. Implementation and Results

Figure 4.2

Refresh permissions to make changes take effect

mysql--Installing Linux (Version 5.6)

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.