Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the three installation methods and versions of MySQL

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how the three installation methods and versions of MySQL are, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Introduction to MYSQL version

Mysql is divided into four versions of alpha,beta,rc,GA.

Alpha implies that this is a version for the purpose of showing new features, there are more unstable factors, and new features will be added to the code.

In future beta versions, releases, or product releases of beta, all API, external visual structures, and SQL command lines are no longer changed, and new features that affect code stability are no longer added to the code.

Rc refers to Release Candidate. Release candidates is considered to be stable, passing all internal tests of mysql and correcting all known fatal bug. But the rc version hasn't taken long enough to confirm that all bug has been found, but only minor bug fixes will be made to the rc version.

If GA does not have a suffix, it implies that this is a version that is available in most cases or a product version. . GA releases is stable and has passed testing of earlier versions and shows its usability, solves all serious bug, and is suitable for use in production environments. Only a few serious bug changes will be added to this release.

There are three common ways to install MySQL:

Rpm package form

Universal binary form

Source code compilation

1pr rpm packet form

(1) provided by the operating system publisher

(2) official (updated version, fixed more common BUG) www.mysql.com/downloads provided by MySQL

Introduction to rpm package types in MySQL:

MySQL-client client component

MySQL-debuginfo debugs the components of MySQL

MySQL-devel wants to install PHP and other MySQL-dependent component packages for MySQL compilation.

Embedded version of MySQL-embedded MySQL

MySQL-server shared library

MySQL-shared shared library

In order to be compatible with older versions of shared libraries, MySQL-shared-dompat

Test component of MySQL-test MySQL (online processing function)

1 MySQL RPM package installation

a. Check MySQL and related RPM packages for installation, and if any, remove (rpm-e name)

[root@localhost ~] # rpm-qa | grep-I mysql

Mysql-libs-5.1.66-2.el6_3.x86_64

[root@localhost ~] # yum-y remove mysql-libs*

b. Download the RPM package for Linux, such as the RPM package for CentOS6.4_64.

[root@localhost rpm] # ll

Total 74364

-rw-r--r--. 1 root root 18442536 Dec 11 20:19 MySQL-client-5.6.15-1.el6.x86_64.rpm

-rw-r--r--. 1 root root 3340660 Dec 11 20:06 MySQL-devel-5.6.15-1.el6.x86_64.rpm

-rw-r--r--. 1 root root 54360600 Dec 11 20:03 MySQL-server-5.6.15-1.el6.x86_64.rpm

c. Install MySQL: rpm-ivh mysql*

[root@localhost rpm] # rpm-ivh MySQL-server-5.6.15-1.el6.x86_64.rpm

[root@localhost rpm] # rpm-ivh MySQL-devel-5.6.15-1.el6.x86_64.rpm

[root@localhost rpm] # rpm-ivh MySQL-client-5.6.15-1.el6.x86_64.rpm

# modify configuration file location

[root@localhost rpm] # cp / usr/share/mysql/my-default.cnf / etc/my.cnf

d. Initialize MySQL and set password

[root@localhost rpm] # / usr/bin/mysql_install_db

[root@localhost rpm] # service mysql start

[root@localhost rpm] # cat / root/.mysql_secret # View root account password

# The random password set for the root user at Wed Dec 11 23:32:50 2013 (local time): qKTaFZnl

Set password for root@'localhost'=password ("123456")

[root@localhost] # mysql-uroot-pqKTaFZnl

Mysql > SET PASSWORD = PASSWORD ('123456'); # set the password to 123456

Mysql > exit

[root@localhost] # mysql-uroot-p123456

e. Allow remote login

Mysql > use mysql

Mysql > select host,user,password from user

+-+

| | host | user | password | |

+-+

| | localhost | root | * 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

| | localhost.localdomain | root | * 1237E2CE819C427B0D8174456DD83C47480D37E8 |

| | 127.0.0.1 | root | * 1237E2CE819C427B0D8174456DD83C47480D37E8 |

| |:: 1 | root | * 1237E2CE819C427B0D8174456DD83C47480D37E8 |

+-+

Mysql > update user set password=password ('123456') where user='root'

Mysql > update user set host='%' where user='root' and host='localhost'

Mysql > flush privileges

Mysql > exit

f. Set Boot self-boot

[root@localhost ~] # chkconfig mysql on

[root@localhost ~] # chkconfig-- list | grep mysql

Mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Default installation location of G. MySQL

/ var/lib/mysql/ # database directory

/ usr/share/mysql # configuration file directory

/ usr/bin # related command directory

/ etc/init.d/mysql # startup script

Modify character set and data storage path

Configure / etc/my.cnf file, modify the data storage path, mysql.sock path and default encoding utf-8.

View character set

Show variables like'% collation%'

Show variables like'% char%'

Rpm-ql MYSQL-client view the installation directory

Rpm-e MYSQL-client MYSQL-server Uninstall

2 MySQL source code compilation installation

Yum install cmake installs the compilation tool

-- download and install cmake

Http://cmake.org/download/

# wget http://cmake.org/files/v3.3/cmake-3.3.2.tar.gz

# tar xzvf cmake-3.3.2.tar.gz

# cd cmake-3.3.2

#. / configure

# gmake & & make install

-- create users

# groupadd mysql

# useradd-g mysql mysql

-- set user operating system resource limits

# vi / etc/security/limits.conf

Mysql soft nproc 2047

Mysql hard nproc 16384

Mysql soft nofile 1024

Mysql hard nofile 65536

-- download and extract the MySQL source file

Https://dev.mysql.com/downloads/mysql/

# tar xzvf mysql-5.6.26.tar.gz

# cd mysql-5.6.26

-- execute cmake to generate a compiled configuration file

Cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DINABLED_LOCAL_INFILE=ON\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_FEDERATED_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\

-DWITH_PARTITION_STORAGE_ENGINE=1\

-DWITH_PERFSCHEMA_STORAGE_ENGINE=1\

-DCOMPILATION_COMMENT='JSS for mysql test'\

-DWITH_READLINE=ON\

-DSYSCONFDIR=/data/mysqldata/3306\

-DMYSQL_UNIX_ADDR=/data/mysqldata/3306/mysql.lock

-- compile and install

# make & & make install

-- modify directory permissions

# chown-R mysql:mysql/usr/local/mysql

-- modify environment variable file

# vi / home/mysql/.bash_profile

Export LANG=zh_CN.GB18030

Export PATH=/usr/local/mysql/bin:$PATH

3 MySQL binary package installation--

Tar cvfz / data/mysql-5.6.tar.gz / usr/local/mysql can package the compiled files, and the following steps are exactly the same as the second one.

About the three installation methods and versions of MySQL is shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report