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

Mysql binary installation

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Step 1 of Mysql installation: create a new user

Groupadd mysql

Useradd-r-g mysql mysql

Cd / usr/local/-- pay attention to path

Chown-R mysql:mysql mysql

Chmod-R 775 mysql

2. Install the dependency package

Yum install libai*-y

Yum install ncurses-devel-y

Yum-y install bison

Yum install zlib zlib-devel-y

Yum install zlib-y

Yum instlal libxml libjpeg freetype libpnggd curl libiconv zlib-devel

Yum install libxml2-devel libjpeg-develfreetype-devel libpng-devel gd-devel curl-devel-y

Yum install gcc-y

3. Extract and place the package under / usr/local to mysql

Tar-xvf mysql-5.5.28-linux2.6-i686.tar.gz

Mv mysql-5.5.28-linux2.6-i686 / usr/local/mysql

5. Initialize the instance

Cd / usr/local/mysql/scripts

Mkdir / data

Chown mysql:mysql / data

Chmod 775 mysql:mysql data

. / mysql_install_db-- user=mysql-- basedir=/usr/local/mysql/-- datadir=/data/

Basedir-mysql software installation path

Datadir- data file storage path

WARNING: The host 'mysql01' could not belooked up with resolveip.

This probably means that your libclibraries are not 100% compatible

With this binary MySQL version. The MySQLdaemon, mysqld, should work

Normally with the exception that host nameresolving will not work.

This means that you should use IP addressesinstead of hostnames

When specifying MySQL privileges!

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have tocopy

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

PLEASE REMEMBER TO SET A PASSWORD FOR THEMySQL root USER!

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

/ usr/local/mysql//bin/mysqladmin-u rootpassword 'new-password'

/ usr/local/mysql//bin/mysqladmin-u root-hmysql01 password' new-password'

Alternatively you can run:

/ usr/local/mysql//bin/mysql_secure_installation

Which will also give you the option ofremoving the test

Databases and anonymous user created bydefault. This is

Strongly recommended for productionservers.

See the manual for more instructions.

You can start the MySQL daemon with:

Cd / usr/local/mysql/; / usr/local/mysql//bin/mysqld_safe &

You can test the MySQL daemon withmysql-test-run.pl

Cd / usr/local/mysql//mysql-test; perlmysql-test-run.pl

Please report any problems with the/usr/local/mysql//scripts/mysqlbug script!

6. Initialize configuration file modification

Cp / usr/local/mysql/support-files/my-small.cnf / etc/my.cnf

[client]

Port = 3306

Socket = / data/mysql.sock

[mysql]

No-auto-rehash

[mysqld]

User = mysql

Port = 3306

Socket = / data/mysql.sock

Basedir = / usr/local/mysql

Datadir = / data

Open_files_limit = 1024

Back_log = 600,

Max_connections = 800,

Max_connect_errors = 3000

Table_cache = 614

External-locking = FALSE

Max_allowed_packet = 8m

Sort_buffer_size = 1m

Join_buffer_size = 1m

Thread_cache_size = 100

Thread_concurrency = 2

Query_cache_size = 2m

Query_cache_limit = 1m

Query_cache_min_res_unit = 2k

# default_table_type = InnoDB

Thread_stack = 19K

# transaction_isolation = READ-COMMITTED

Tmp_table_size = 2m

Max_heap_table_size = 2m

Long_query_time = 1

# log_long_format

# log-error = / data/error.log

# log-slow-queries = / data/slow.log

Pid-file = / data/mysql.pid

Log-bin = / data/mysql-bin

Relay-log = / data/relay-bin

Binlog_cache_size = 1m

Max_binlog_cache_size = 1m

Max_binlog_size = 2m

Expire_logs_days = 7

Key_buffer_size = 16m

Read_buffer_size = 1m

Read_rnd_buffer_size = 1m

Bulk_insert_buffer_size = 1m

# myisam_sort_buffer_size = 1m

# myisam_max_sort_file_size = 10G

# myisam_max_extra_sort_file_size = 10G

# myisam_repair_threads = 1

# myisam_recover

Lower_case_table_names = 1

Skip-name-resolve

Slave-skip-errors = 1032 and 1062

Replicate-ignore-db=mysql

Server-id = 1

Innodb_additional_mem_pool_size = 4m

Innodb_buffer_pool_size = 32m

Innodb_data_file_path = ibdata1:128M:autoextend

Innodb_file_io_threads = 4

Innodb_thread_concurrency = 8

Innodb_flush_log_at_trx_commit = 2

Innodb_log_buffer_size = 2m

Innodb_log_file_size = 4m

Innodb_log_files_in_group = 3

Innodb_max_dirty_pages_pct = 90

Innodb_lock_wait_timeout = 120

Innodb_file_per_table = 0

[mysqldump]

Quick

Max_allowed_packet = 2m

[mysqld_safe]

Log-error=/data/mysql_oldboy3306.err

Pid-file=/data/mysqld.pid

Mysql startup 1. Configure environment variables

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

2. Start and stop the database

Mysqld_safe-defaults-file=/etc/my.cnf-user=mysql &

-- defaults-file indicates the configuration file path

-- user specifies which user to launch

Mysql basic management and maintenance login mysql local server multi-instance login mysql

Mysql-u-p-- socket=/data/mysql.sock

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