標籤:art restart ati 檔案夾 mem monitor trade 調整 gcc
1、下載源碼包
#wget?https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.17.tar.gz
2、進入解壓目錄
cd mysql-5.7.17
3、安裝相關依賴
[[email protected] mysql-5.7.17]# yum install -y cmake gcc-c++* make ncurses-devel
2、4、建立mysql運行使用者
[[email protected] mysql-5.7.18]# useradd -M -s /sbin/nologin mysql
5、執行源碼編譯
#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL-USER=mysql -DDOWNLOAD_BOOST=1 -DWITH_BOOST=./boost
3、編譯之後,下面就是安裝了,執行如下命令
#make -j 4 && make install
在編譯的時候,如果虛擬機器或是機器配置過低會報如下錯誤,建議配置為4核4G的配置來安裝,我的安裝是卡到75%這裡,然後就不動了
cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"
調整完配置之後,再執行上面的安裝命令
#make -j 4 && make install
7、變更檔夾屬主和屬組
chown -R mysql.mysql /usr/local/mysql/
8、手動添加編輯設定檔
[[email protected] mysql-5.7.18]# cd /usr/local/mysql/support-files/
[[email protected] support-files]# vim my-default.cnf
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
socket = /tmp/mysql.sock
character-set-server=utf8
back_log = 300
max_connections = 3000
max_connect_errors = 50
table_open_cache = 4096
max_allowed_packet = 32M
#binlog_cache_size = 4M
max_heap_table_size = 128M
read_rnd_buffer_size = 16M
sort_buffer_size = 16M
join_buffer_size = 16M
thread_cache_size = 16
query_cache_size = 128M
query_cache_limit = 4M
ft_min_word_len = 8
thread_stack = 512K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 128M
#log-bin=mysql-bin
long_query_time = 6
server_id=1
innodb_buffer_pool_size = 1G
innodb_thread_concurrency = 16
innodb_log_buffer_size = 16M
innodb_log_file_size = 512M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = on
[mysqldump]
quick
max_allowed_packet = 32M
[mysql]
no-auto-rehash
default-character-set=utf8
safe-updates
[myisamchk]
key_buffer = 16M
sort_buffer_size = 16M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192
[client]
9、初始化mysql服務
bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
10、複製設定檔
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
11、複製啟動指令碼
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
12、修改啟動指令碼,在下面這個位置後面寫上安裝路徑
vim /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
13、啟動mysql 服務
cd /usr/local/mysql/bin/./mysqld_safe --user=mysql &service mysqld restart
Shutting down MySQL. SUCCESS!?
Starting MySQL. SUCCESS!?
14 做軟串連,讓系統直接調用
ln -s /usr/local/mysql/bin/* /bin/
15、登入資料庫報如下錯誤,卡到這裡了
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)
系統沒有找到mysql.sock檔案
這裡查看設定檔裡寫的是mysqld.sock??把設定檔裡的mysqld.sock改成mysql.sock重啟mysql 服務,就可以登入了
預設沒有密碼直接登入的
mysql
Welcome to the MySQL monitor.??Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18 Source distribution
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
mysql>
16、登入資料庫修改密碼
mysql> SET PASSWORD = PASSWORD(‘Xinwangai7/‘);
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
測試用新密碼登入
mysql -u root -p
Enter password:?
Welcome to the MySQL monitor.??Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.18 Source distribution
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
mysql>?
mysql-boost-5.7.17安裝