centos6.5下的mysql5.6.30安裝
阿新 • • 發佈:2017-09-21
ack ble max 啟動 nal html name root base
http://www.cnblogs.com/fujinzhou/p/5750442.html
centos6.5下的mysql5.6.30安裝
1.解壓mysql tar -xf mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz -C /usr/local mv mysql-5.6.30-linux-glibc2.5-x86_64 mysql-5.6.30 2.添加用戶與組 groupadd mysql useradd -g mysql mysql -s /sbin/nologin chown -R mysql:mysql mysql-5.6.30 3.安裝數據庫 mkdir /usr/local/mysql-5.6.30/data3306 cd mysql-5.6.21/scripts ./mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.6.30/ --datadir=/usr/local/mysql-5.6.30/data3306/ 4.配置文件 cd /usr/local/mysql-5.6.30/support-files cp my-default.cnf /etc/my.cnf cp mysql.server /etc/init.d/mysql vim /etc/init.d/mysql 修改文件中的兩個變更值 [mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock max-connections = 800 skip-name-resolve skip-external-locking key_buffer_size = 384M max_allowed_packet = 1073M table_open_cache = 512 sort_buffer_size = 512K read_buffer_size = 512K read_rnd_buffer_size = 512K join_buffer_size = 128K myisam_sort_buffer_size = 64M thread_cache_size = 256 query_cache_size = 0 query_cache_type = 0 tmp_table_size = 64M max_heap_table_size = 64M basedir=/usr/local/mysql-5.6.30/ datadir=/usr/local/mysql-5.6.30/data3306 pid-file = /usr/local/mysql-5.6.30/data3306/mysql.pid log_error = /var/log/mysqld.log # set binary logging is required for replication log-bin=mysql-bin binlog_cache_size = 32M # event_scheduler shutoff in mysqld slave event_scheduler = 1 binlog_format=row expire_logs_days = 3 # set slow log slow_query_log = 1 long_query_time = 2 #set 字符 character_set_server = utf8 #set 大小寫敏感 lower_case_table_names=1 # set innodb params innodb_data_home_dir = /usr/local/mysql-5.6.30/data3306 innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend innodb_log_group_home_dir = /usr/local/mysql-5.6.30/data3306 innodb_buffer_pool_size = 5972M innodb_additional_mem_pool_size = 10M innodb_log_file_size = 512M innodb_log_buffer_size = 16M innodb_flush_log_at_trx_commit = 2 innodb_flush_method = O_DIRECT innodb_file_per_table = 1 innodb_lock_wait_timeout = 10 [client] default-character-set = utf8 5.配置環境變量 vi /etc/profile export MYSQL_HOME="/usr/local/mysql-5.6.30" export PATH="$PATH:$MYSQL_HOME/bin" 6.添加自啟動服務 chkconfig mysql on 7.啟動mysql service mysql start 8.登錄mysql及改密碼 mysqladmin -u root password ‘your_password‘ #修改root用戶密碼 mysql -u root -p #登錄mysql,需要輸入密碼centos6.5下的mysql5.6.30安裝