MysqlinstallationInstallation Steps1, new user
Groupadd MySQL
Useradd-r-G MySQL MySQL
cd/usr/local/---------------------------- Note the path
Chown-r Mysql:mysql MySQL
Chmod-r 775 MySQL
2, install dependent packages
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, unzip and place the package in/usr/localdown toMysql
TAR-XVF mysql-5.5.28-linux2.6-i686.tar.gz
MV Mysql-5.5.28-linux2.6-i686/usr/local/mysql
5, initializing instances
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 is not compatible
With this binary MySQL version. The Mysqldaemon, mysqld, should work
Normally with the exception that host nameresolving won't work.
This means, 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 with tocopy
Support-files/mysql.server to the rightplace for your system
REMEMBER to SET A PASSWORD for themysql root USER!
To do, 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 would 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
Problems with The/usr/local/mysql//scripts/mysqlbug script!
6, initializing 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 = 192K
#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,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
MysqlStart1, configure environment variables
Path= $PATH: $HOME/bin:/usr/local/mysql/bin
2, start-Stop database
Mysqld_safe--defaults-file=/etc/my.cnf--user=mysql &
--defaults-file represents a configuration file path
--user Specifies to start with that user
MysqlBasic management and MaintenanceLoginMysqllocal server Multi-instance loginMysql
Mysql-u-P--socket=/data/mysql.sock
This article is from the "11300506" blog, please be sure to keep this source http://11310506.blog.51cto.com/11300506/1962150
MySQL binary installation