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

Method of installing MySQL5.7.15 through binary source code based on Centos6.5

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

Share

Shulou(Shulou.com)06/01 Report--

Let me tell you a little bit about the method of installing MySQL5.7.15 through binary source code based on Centos6.5. Have you known about similar topics before? If you are interested, let's take a look at this article. I believe it will be of some help to you after reading the Centos6.5-based method of installing MySQL5.7.15 through binary source code.

[root@mysqlserver ~] # uname-aLinux mysqlserver2.6.32-431.el6.x86_64 # 1 SMP Fri Nov 22 03:15:09 UTC 2013 x86 "64 x86" 64 x86_64GNU/ Linux [root @ mysqlserver ~] # cat / etc/redhat-releaseCentOS release 6.5 (Final) 1.MySQL package preparation

This actual use, the download is the version is the mysql5.7.15 community version. The installation package downloads the binary source code compiler-free package. Can be downloaded from the official website of mysql, http://dev.mysql.com/downloads/mysql/

The following links I have downloaded and saved in the network disk, you can also refer to and use.

Http://pan.baidu.com/s/1eSr57oQ

(the official website has been updated to 5.7.16)

Mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz

The installation package is uploaded to the centos system through ftp or secureCRT tools

two。 Extract the MySQL package, specify the installation directory, and modify the MySQL directory name

After uploading the mysql installation package to the centos system, extract the package. Copy the extracted directory to / usr/local/ and rename it to mysql,/usr/local/mysql, which is the directory where the MySQL database is installed.

[root@mysqlserver mysql] tar xfz mysql-5.7.15-linux-glibc2.5-x86_ 64.tar.gz [root @ mysqlserver mysql] mv mysql-5.7.15-linux-glibc2.5-x86_64 / usr/local/mysql [root@mysqlserver mysql] ln-svmysql-5.7.15-linux-glibc2.5-x86_64 / usr/local/mysql

3. Create mysql user [root@mysqlserver mysql] # groupadd mysql [root@mysqlserver mysql] # useradd-g mysql-s/sbin/nologin-M mysql [root@mysqlserver mysql] # id mysql # check whether the creation is successful

4. Create the mysql data directory and log directory. Mysql uses this data directory [root@mysqlserver mysql] # mkdir / mysql/ mysql/data / mysql/log when initializing the database

5. Change directory permissions

Change the directory permissions so that mysql can proceed smoothly during initialization.

[root@mysqlserver mysql] # chown-R mysql:mysql / usr/local/mysql / mysql

6. Create my.cnf file [root@mysqlserver local] # vi / etc/my.cnf

The configuration file is as follows:

[client]

Port = 3306

Socket = / tmp/mysql.sock

[mysqld]

Server_id=10

Port = 3306

User = mysql

Socket = / tmp/mysql.sock

Basedir = / usr/local/mysql

Datadir = / mysql/data

Pid-file = / mysql/data/mysql.pid

Max_connections = 1000

Max_connect_errors = 1000

Table_open_cache = 1024

Max_allowed_packet = 128m

Open_files_limit = 65535

# [innodb]

Innodb_buffer_pool_size = 1024m

Innodb_file_per_table = 1

Innodb_write_io_threads = 4

Innodb_read_io_threads = 4

Innodb_purge_threads = 2

Innodb_flush_log_at_trx_commit = 1

Innodb_log_file_size = 512m

Innodb_log_files_in_group = 2

Innodb_log_buffer_size = 16m

Innodb_max_dirty_pages_pct = 80

Innodb_lock_wait_timeout = 30

Innodb_data_file_path=ibdata1:1024M:autoextend

# # log

Log_error = / mysql/log/mysql-error.log

Slow_query_log = 1

Long_query_time = 1

Slow_query_log_file = / mysql/log/mysql-slow.log

Sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Note: only some simple configurations have been made here. If you need it later, you can add your own configuration as needed.

7. Initialize the database

Key note: the initialization method before 5.7.6 is:

Database installation directory / scripts/mysql_install_db--user=mysql

This actual operation downloads the latest version 5.7.15, which is later than 5.7.6, to initialize the database instead of using mysql_install_db.

Bin/mysqld-initialize--user=mysql--basedir=/usr/local/mysql--datadir=/mysql/data

7.1 enter the database directory and complete the initialization of [root@mysqlserver mysql] bin/mysqld-- initialize-- user=mysql-- basedir=/usr/local/mysql-- datadir=/mysql/data-- innodb_undo_tablespaces=3--explicit_defaults_for_timestamp under / usr/local/mysql.

If log_error for my.cnf is configured, the initial password is in the log_error file, otherwise it will be printed. In the following picture, the red handwriting check is the password. A temporary is generated forroot@localhost:-7&YUR > / etc/profile

Make the environment variable of the added mysql take effect.

[root@mysqlserver bin] # source / etc/profile [root@mysqlserver bin] # echo $PATH/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin

Summary of the addition of MySQL environment variables

Echo 'export PATH=/mysql installation directory / bin:$PATH' > > / etc/profile

Tail-l / etc/profile

Source / etc/profile

Echo $PATH

7.4 set boot MySQL [root @ mysqlserver bin] # chkconfig-- add mysql [root@mysqlserver bin] # chkconfig mysql on [root@mysqlserver bin] # chkconfig-- list mysqlmysql 0: close 1: close 2: enable 3: enable 4: enable 5: enable 6: close 8. Log in to the database [root@mysqlserver] # mysql-uroot-pEnter password:Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 5Server version: 5.7.15-log MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates.All rights reserved.Oracle is a registered trademark of OracleCorporation and/or itsaffiliates. Other names may be trademarks of theirrespectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clearthe current input statement.

At this point, the installation of MySQL5.7 is almost complete. In the process of collating the article, it is inevitable that there will be mistakes or improper expression. I hope you will point out the shortcomings and give suggestions or opinions after the actual operation.

9. Matters needing attention

The field in which the password is stored in 5.7is no longer password, it becomes authentication_string

Update mysql.user

Set authentication_string=password ('root') where user='root'

What do you think of the article about installing MySQL5.7.15 through binary source code based on Centos6.5 and whether it has gained anything? If you want to know more about it, you can continue to follow our industry information section.

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