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

How to install mysql5.6.37 with source code

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces "how to install mysql5.6.37 with source code". In daily operation, I believe many people have doubts about how to install mysql5.6.37 with source code. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to install mysql5.6.37 with source code". Next, please follow the editor to study!

MYSQL source code installation:

Modify the parameter file:

Vi / etc/security/limits.conf

Mysql soft nproc 2047

Mysql hard nproc 16384

Mysql soft nofile 1024

Mysql hard nofile 65536

Download 5.6.37 source code

Install with cmake after decompression:

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

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DENABLED_LOCAL_INFILE=ON\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWICH_FEDERATED_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\

-DWITH_PARTITION_STORAGE_ENGINE=1\

-DWITH_PREFSCHEMA_STORAGE_ENGINE=1\

-DCOMPILATION_COMMENT='JSS for mysqltest'\

-DWITH_READLINE=ON\

-DSYSCONFDIR=/data/mysqldata/3306\

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

Install after compilation and weighing

Make & & make install

Chown-R mysql:mysql / usr/local/mysql

Export LANG=zh_CN.CB18030

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

Cd / data/

Mkdir-p / data/mysqldata/ {3306 / {data,tmp,binlog}, backup,scripts}

Chown-R mysql:mysql mysqldata

Su-mysql

Cd / usr/local/mysql

Edit parameter file

/ data/mysqldata/3306/my.cnf

[client]

Port = 3306

Socket = / data/mysqldata/3306/mysql.sock

# The MySQL server

[mysqld]

Port = 3306

User = mysql

Socket = / data/mysqldata/3306/mysql.sock

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

Basedir = / usr/local/mysql

Datadir = / data/mysqldata/3306/data

Tmpdir = / data/mysqldata/3306/tmp

Open_files_limit = 10240

Explicit_defaults_for_timestamp

Sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

# Buffer

Max_allowed_packet = 256m

Max_heap_table_size = 256m

Net_buffer_length = 8k

Sort_buffer_size = 2m

Join_buffer_size = 4m

Read_buffer_size = 2m

Read_rnd_buffer_size = 16m

# Log

Log-bin = / data/mysqldata/3306/binlog/mysql-bin

Binlog_cache_size = 32m

Max_binlog_cache_size = 512m

Max_binlog_size = 512m

Binlog_format = mixed

Log_output = FILE

Log-error =.. / mysql-error.log

Slow_query_log = 1

Slow_query_log_file =.. / slow_query.log

General_log = 0

General_log_file =.. / general_query.log

Expire-logs-days = 14

# InnoDB

Innodb_data_file_path = ibdata1:2048m:autoextend

Innodb_log_file_size = 256m

Innodb_log_files_in_group = 3

Innodb_buffer_pool_size = 1024m

[mysql]

No-auto-rehash

Prompt = (\ u @\ h) [\ d] >\ _

Default-character-set=gbk

Initialize db

/ usr/local/mysql/scripts/mysql_install_db-datadir=/data/mysqldata/3306/data-basedir=/usr/local/mysql

Here, an error occurred due to the manual typing of the parameter file and needs to be reinitialized. The steps are as follows:

1 Delete / usr/local/mysql/my.cnf

2 delete all files under / data/mysqldata/3306 except my.cnf, and recreate the binlog,data,tmp directory under this directory

3 rerun the initialization script

Start mysql

Mysqld_safe-- defaults-file=/data/mysqldata/3306/my.cnf &

Netstat-lnt | grep 3306

Ps-ef | grep bin/mysql | grep-v grep

Set the administrator user and password:

Mysql

Select user,host from mysql.user

Delete from mysql.user where (user,host) not in (select 'root','localhost')

Update mysql.user set user='system',password=password ('xxxxxxxxx')

Truncate table mysql.db

Flush privileges

It's safe.

At this point, the study on "how to install mysql5.6.37 with source code" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Wechat

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

12
Report