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

Mysql5.6 notes in binary mode for CentOS installation

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

Share

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

CentOS installation uses binary mysql5.6 note 1, upload installation package-use root user

2. Extract the installation package-use root users

Cd / usr/local/

Tar xzvf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz

Mv mysql-5.6.23-linux-glibc2.5-x86_64 mysql

3. Create mysql to manage user groups and users-- use root users

Groupadd-g 101 dba

Useradd-u 514-g dba-G root-d / usr/local/mysql mysqladmin

Authentication: id mysqladmin

4. Modify the password of mysqladmin user-use root user

Passwd mysqladmin

Tip:

Changing password for user mysqladmin.

New UNIX password:

BAD PASSWORD: it is too simplistic/systematic

Retype new UNIX password:

Passwd: all authentication tokens updated successfully.

5. Configure the copy environment variable to the home directory of the mysqladmin user, and configure the personal environment variable for the following steps-- use the root user

Cp / etc/skel/.* / usr/local/mysql

Tip:

Cp: omitting directory `/ etc/skel/.'

Cp: omitting directory `/ etc/skel/..'

Cp: omitting directory `/ etc/skel/.mozilla'

6. Modify the / etc/my.cnf file, delete the contents of the original file, and fill in the following into the my.cnf file-using root users

Vi / etc/my.cnf

[client]

Port = 3306

Socket = / usr/local/mysql/data/mysql.sock

[mysqld]

Port = 3306

Socket = / usr/local/mysql/data/mysql.sock

Skip-external-locking

Key_buffer_size = 256m

Sort_buffer_size = 2m

Read_buffer_size = 2m

Read_rnd_buffer_size = 4m

Query_cache_size= 32M

Max_allowed_packet = 16m

Myisam_sort_buffer_size=128M

Tmp_table_size=32M

Table_open_cache = 512

Thread_cache_size = 8

Wait_timeout = 86400

Interactive_timeout = 86400

Max_connections = 600,

# Try number of CPU's*2 for thread_concurrency

Thread_concurrency = 32

# isolation level and default engine

Default-storage-engine = INNODB

Transaction-isolation = READ-COMMITTED

Server-id = 1

Basedir = / usr/local/mysql

Datadir = / usr/local/mysql/data

Pid-file = / usr/local/mysql/data/hostname.pid

# open performance schema

Log-warnings

Sysdate-is-now

Binlog_format = MIXED

Log_bin_trust_function_creators=1

Log-error = / usr/local/mysql/data/hostname.err

Log-bin=/usr/local/mysql/arch/mysql-bin

# other logs

# general_log = 1

# general_log_file = / usr/local/mysql/data/general_log.err

# slow_query_log=1

# slow_query_log_file=/usr/local/mysql/data/slow_log.err

# for replication slave

# log-slave-updates

# sync_binlog = 1

# for innodb options

Innodb_data_home_dir = / usr/local/mysql/data/

Innodb_data_file_path = ibdata1:500M:autoextend

Innodb_log_group_home_dir = / usr/local/mysql/arch

Innodb_log_files_in_group = 2

Innodb_log_file_size = 200m

Innodb_buffer_pool_size = 2048m

Innodb_additional_mem_pool_size = 50m

Innodb_log_buffer_size = 16m

Innodb_lock_wait_timeout = 100

# innodb_thread_concurrency = 0

Innodb_flush_log_at_trx_commit = 1

Innodb_locks_unsafe_for_binlog=1

# innodb io features: add for mysql5.5.8

Performance_schema

Innodb_read_io_threads=4

Innodb-write-io-threads=4

Innodb-io-capacity=200

# purge threads change default (0) to 1 for purge

Innodb_purge_threads=1

Innodb_use_native_aio=on

# case-sensitive file names and separate tablespace

Innodb_file_per_table = 1

Lower_case_table_names=1

[mysqldump]

Quick

Max_allowed_packet = 16m

[mysql]

No-auto-rehash

[mysqlhotcopy]

Interactive-timeout

[myisamchk]

Key_buffer_size = 256m

Sort_buffer_size = 256m

Read_buffer = 2m

Write_buffer = 2m

7. Modify / etc/my.cnf file user groups and users, permissions-use root users

Cd / usr/local

Chown mysqladmin:dba / etc/my.cnf

Chmod 640 / etc/my.cnf

Verify:

Ll my.cnf

-rw-r- 1 mysqladmin dba 2201 Dec 19 11:19:40 my.cnf

8. Modify mysql installation file user groups and users, permissions-use root users

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

Chmod-R 755 / usr/local/mysql

Su-mysqladmin

Pwd shows: / usr/local/mysql

9. Create an arch directory-- use mysqladmin users

Cd / usr/local/mysql

Mkdir arch

10. Check whether the gcc, libaio, perl, and perl-devel packages are installed

Rpm-qa | grep gcc libaio perl perl-devel

If not, use yum to install: yum-y install libaio, yum-y install gcc, yum-y install perl

11. Binary installation

Scripts/mysql_install_db-user=mysqladmin-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data

Tip:

Installing MySQL system tables...2017-12-19 11:39:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

OK

Filling help tables...2017-12-19 11:39:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

OK

To start mysqld at boot time you have to copy

Support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER!

To do so, start the server, then issue the following commands:

. / bin/mysqladmin-u root password' new-password'

. / bin/mysqladmin-u root-h sht-sgmhadoopnn-01 password' new-password'

Alternatively you can run:

. / bin/mysql_secure_installation

Which will also give you the option of removing the test

Databases and anonymous user created by default. This is

Strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

Cd. ;. / bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

Cd mysql-test; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

Http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as. / my.cnf and

Will be used by default by the server when you start it.

You may edit this file to change server settings

WARNING: Default config file / etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, or use the

-- defaults-file argument to mysqld_safe when starting the server

12. Start mysql-- and use mysqladmin users

Su-mysqladmin

Cd / usr/local/mysql

Rm-rf my.cnf

Bin/mysqld_safe &

Verify whether to start: ps-ef | grep mysqld, netstat-tulnp | grep mysql

13. Log in to mysql and modify the root password in mysql-- use the mysqladmin user

Mysql

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

| | test |

+-+

Note: if mysql database name is used, exit (exit) use: mysql-uroot-p. Enter directly when prompted for password.

Mysql > use mysql

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

Mysql > select host,user,password from user

Mysql > delete from user where user=''

Mysql > select host,user,password from user

Mysql > flush privileges

Jose big data Exchange Group: 671914634

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