1. 程式人生 > >linux 下mysql 5.7.9tar 包安裝

linux 下mysql 5.7.9tar 包安裝

1、軟體下載

登入到 http://dev.mysql.com/downloads/mysql/  ,選擇對應的版本進行下載。


2、建立mysql 使用者

[[email protected] ~]# groupadd mysql
[[email protected] ~]# useradd -g mysql mysql
[[email protected] ~]# passwd mysql

將tar 包拷貝到mysql的home 目錄下,進行解壓後得到的目錄 重新命名為 mysql-5.7.9 

3、安裝資料庫

進入 /home/mysql/mysql-5.7.9/bin 

[
[email protected]
bin]$ ./mysql_install_db --user=mysql --basedir=/home/mysql/ --datadir=/home/mysql/data 2015-11-19 06:49:00 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize 2015-11-19 06:49:07 [ERROR] The bootstrap log isn't empty: 2015-11-19 06:49:07 [ERROR] 2015-11-19T14:49:01.852039Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead 2015-11-19T14:49:01.868000Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000) 2015-11-19T14:49:01.868056Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000) 2015-11-19T14:49:01.888730Z 0 [ERROR] Can't read from messagefile '/usr/share/mysql/english/errmsg.sys'

提示mysql_install_db 命令已棄用,使用mysqld 
[[email protected] bin]$ ./mysqld --user=mysql --basedir=/home/mysql/ --datadir=/home/mysql/data
2015-11-19T14:50:18.145225Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2015-11-19T14:50:18.145526Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2015-11-19T14:50:18.797964Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-19T14:50:18.798019Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2015-11-19T14:50:18.798053Z 0 [Note] ./mysqld (mysqld 5.7.9) starting as process 3578 ...
2015-11-19T14:50:18.798104Z 0 [ERROR] Can't find error-message file '/home/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2015-11-19T14:50:18.802586Z 0 [Note] InnoDB: PUNCH HOLE support not available
2015-11-19T14:50:18.802645Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-19T14:50:18.802656Z 0 [Note] InnoDB: Uses event mutexes
2015-11-19T14:50:18.802665Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2015-11-19T14:50:18.802674Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-19T14:50:18.802682Z 0 [Note] InnoDB: Using Linux native AIO
2015-11-19T14:50:18.803153Z 0 [Note] InnoDB: Number of pools: 1
2015-11-19T14:50:18.803868Z 0 [Note] InnoDB: Using CPU crc32 instructions
2015-11-19T14:50:18.843406Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2015-11-19T14:50:18.860507Z 0 [Note] InnoDB: Completed initialization of buffer pool
2015-11-19T14:50:18.864349Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2015-11-19T14:50:18.878937Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-19T14:50:18.901395Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2015-11-19T14:50:18.901629Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2015-11-19T14:50:18.943961Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2015-11-19T14:50:18.945376Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2015-11-19T14:50:18.945403Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2015-11-19T14:50:18.952368Z 0 [Note] InnoDB: 5.7.9 started; log sequence number 2471242
2015-11-19T14:50:18.974882Z 0 [Note] InnoDB: Loading buffer pool(s) from /home/mysql/data/ib_buffer_pool
2015-11-19T14:50:18.976665Z 0 [Note] InnoDB: Buffer pool(s) load completed at 151119  6:50:18
2015-11-19T14:50:18.978694Z 0 [Note] InnoDB: not started
2015-11-19T14:50:18.978878Z 0 [Note] Plugin 'FEDERATED' is disabled.
2015-11-19T14:50:18.983412Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2015-11-19T14:50:18.984289Z 0 [Warning] CA certificate ca.pem is self signed.
2015-11-19T14:50:19.003696Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2015-11-19T14:50:19.021246Z 0 [Note] IPv6 is available.
2015-11-19T14:50:19.021291Z 0 [Note]   - '::' resolves to '::';
2015-11-19T14:50:19.021299Z 0 [Note] Server socket created on IP: '::'.
2015-11-19T14:50:19.037949Z 0 [ERROR] Could not create unix socket lock file /var/lib/mysql/mysql.sock.lock.
2015-11-19T14:50:19.037976Z 0 [ERROR] Unable to setup unix socket lock file.
2015-11-19T14:50:19.037982Z 0 [ERROR] Aborting

2015-11-19T14:50:19.038004Z 0 [Note] Binlog end
2015-11-19T14:50:19.038084Z 0 [Note] Shutting down plugin 'ngram'
2015-11-19T14:50:19.038094Z 0 [Note] Shutting down plugin 'ARCHIVE'
2015-11-19T14:50:19.038098Z 0 [Note] Shutting down plugin 'partition'
2015-11-19T14:50:19.038102Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2015-11-19T14:50:19.038106Z 0 [Note] Shutting down plugin 'CSV'
2015-11-19T14:50:19.038112Z 0 [Note] Shutting down plugin 'MEMORY'
2015-11-19T14:50:19.038118Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2015-11-19T14:50:19.038124Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2015-11-19T14:50:19.038128Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-11-19T14:50:19.038131Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-11-19T14:50:19.038135Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-11-19T14:50:19.038138Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-11-19T14:50:19.038142Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-11-19T14:50:19.038145Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-11-19T14:50:19.038149Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-11-19T14:50:19.038152Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-11-19T14:50:19.038155Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-11-19T14:50:19.038159Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-11-19T14:50:19.038162Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-11-19T14:50:19.038165Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-11-19T14:50:19.038168Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-11-19T14:50:19.038172Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-11-19T14:50:19.038175Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-11-19T14:50:19.038179Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2015-11-19T14:50:19.038182Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2015-11-19T14:50:19.038186Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-11-19T14:50:19.038189Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-11-19T14:50:19.038192Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-11-19T14:50:19.038196Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-11-19T14:50:19.038199Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-11-19T14:50:19.038203Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-11-19T14:50:19.038206Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-11-19T14:50:19.038210Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-11-19T14:50:19.038213Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2015-11-19T14:50:19.038217Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-11-19T14:50:19.038221Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-11-19T14:50:19.038224Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2015-11-19T14:50:19.038228Z 0 [Note] Shutting down plugin 'InnoDB'
2015-11-19T14:50:19.038317Z 0 [Note] InnoDB: FTS optimize thread exiting.
2015-11-19T14:50:19.038421Z 0 [Note] InnoDB: Starting shutdown...
2015-11-19T14:50:19.151526Z 0 [Note] InnoDB: Dumping buffer pool(s) to /home/mysql/data/ib_buffer_pool
2015-11-19T14:50:19.152515Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 151119  6:50:19
2015-11-19T14:50:20.802442Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2471261
2015-11-19T14:50:20.811473Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2015-11-19T14:50:20.811528Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-11-19T14:50:20.811690Z 0 [Note] Shutting down plugin 'MyISAM'
2015-11-19T14:50:20.811730Z 0 [Note] Shutting down plugin 'sha256_password'
2015-11-19T14:50:20.811739Z 0 [Note] Shutting down plugin 'mysql_native_password'
2015-11-19T14:50:20.812061Z 0 [Note] Shutting down plugin 'binlog'
2015-11-19T14:50:20.813161Z 0 [Note] 


4、配置檔案

[[email protected] ~]# cd /home/mysql/mysql-5.7.9/support-files/
[[email protected] support-files]# cp my-default.cnf /etc/my.cnf 
cp: overwrite `/etc/my.cnf'? yes
[[email protected] support-files]# cp mysql.server /etc/init.d/mysql

vim /etc/init.d/mysql   

basedir=/home/mysql/
datadir=/home/mysql/data

5、配置環境變數

[[email protected] ~]$ vi .bash_profile 
PATH=$PATH:$HOME/bin
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

export MYSQL_HOME="/home/mysql/mysql-5.7.9"
export PATH="$PATH:$MYSQL_HOME/bin"
~
6、新增開機啟動服務 chkconfig --add mysql chkconfig mysql on
7、啟動mysql 
[[email protected] support-files]# su - mysql
[[email protected] ~]$ service mysql start
/etc/init.d/mysql: line 256: my_print_defaults: command not found
Starting MySQL ERROR! Couldn't find MySQL server (/home/mysql//bin/mysqld_safe)

啟動報錯了,原來是編輯/etc/init.d/mysql  檔案出錯了,修改為下面

vim /etc/init.d/mysql   

basedir=/home/mysql/mysql-5.7.9
datadir=/home/mysql/data

[[email protected] ~]$ service mysql start
Starting MySQL. SUCCESS! 
再次啟動成功

相關推薦

linux mysql 5.7.9tar 安裝

1、軟體下載 登入到 http://dev.mysql.com/downloads/mysql/  ,選擇對應的版本進行下載。 2、建立mysql 使用者 [[email protected] ~]# groupadd mysql [[email 

WindowsMySQL 5.7壓縮安裝

新電腦想安裝Mysql資料庫,現在最新版的資料庫是MySQL 5.7.23 根據自己的系統來進行選擇 解壓之後 第一步建立my.ini檔案 [client] port=3306 default-character-set=utf8 [mysqld] b

【札記】Linux MySQL-5.7.17 tar.gz 方式安裝部署後出現密碼過期的問題解決(不修改/etc/my.cnf檔案)

【問題描述】 在Oracle linux 6.8上安裝完成MySQL-5.7.17(使用版本為:mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz)後: [[email protected] ~]# mysql --version mysql  Ver 14.14 D

Linuxmysql-5.7.20安裝

版本 symbol 問題 init temporary rar files sans AS 1 參考文檔 https://dev.mysql.com/doc/refman/5.7/en/source-installation.html https://dev.mysql.c

linuxmysql 5.7.21 安裝

      # tar -zxvf mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz   解壓      # mv mysql-5.7.21-linux-glibc2.12-x86_64  mysql       重新命名      # c

LinuxMySQL 5.7.23無法遠端連線解決方案

MySQL 版本:5.7.23作業系統:Linux問題描述:只能通過Linux系統賬號Root命令列進入資料庫,無法使用JDBC,遠端連線工具進入資料庫。報錯:ERROR 1698 (28000): Access denied for user 'root'@'localhost'這個問題明顯就是沒有開放遠端

windowsmysql 5.7.24 .msi安裝板的下載步驟

1.先下載好 mysql5.7.24 版本的安裝包,可以去mysql https://www.mysql.com/downloads/ 官網自己下載.     1.1 首先,進入官網後 出現如下介面 我們選擇

LinuxMySQL 5.7的初始化

要用管理員賬號執行。 systemctl start mysql#啟動MySQL服務 mysqld_safe --user=mysql &#啟動MySQL服務(安全方式) mysql -u root -p#登入MySQL(有密碼) mysql -u root#登入MySQL(無密碼) 成功進

centos 7.4 64bitmysql 5.7.24簡易安裝

1、檢視軟體環境     #檢視作業系統版本     [[email protected] mysql]# cat /etc/redhat-release     CentOS Linux release 7.4.1708 (Core)     #檢視作業系統是否6

windows mysql-5.7.20-winx64安裝筆記

windows mysql-5.7.20-winx64 1、mysql根目錄建立:my.ini [mysqld] #繫結IPv4 bind-address = 0.0.0.0 # 設定mysq

linux mysql 5.7 配置 my.cnf(mysqld.cnf)檔案位置 以及具體的配置方式

一、問題 mysql 5.7 版本,/etc/my.cnf  和 /etc/mysql/my.cnf  空空如也,需要自己新增需要的配置,而不能像之前一樣 只要去掉 #號註釋即可。 可以參考djCode的blogMySQL的my.cnf檔案(解決5.7.18下沒有my-d

LINUXMySQL 5.6.26 二進位制安裝

1.前言     MySQL有三種安裝方式:RPM安裝、二進位制包安裝、原始碼包安裝。這3種種方式各有特色,主要特點參考下表。實際應用中,可以根據你所用的主機環境進行優化,選擇最佳的配置值,安裝定製更

關於linux-Centos 7mysql 5.7.9的rpm安裝方式

mysql 5.7.9的rpm包的安裝方環境介紹>>>>>>>>>>>>>>>>>>操作系統:Centos 7.1mysql數據庫版本:mysql5.7.9mysql官方網站:http://www.my

Macmysql 5.7.14壓縮安裝

前言:寫個紀錄,免得倒黴又重新踩坑 MySql下載 網址: http://dev.mysql.com/downloads/mysql/,這個地址最下面選擇一個點選其右側Download按鈕即可下載這裡喔只針對tar.gz包 點

Linux系統 MySQL 5.7和8.0 版本安裝指南

一. 準備工作 1 刪除本地7中的mariadb: 檢視系統中是否已安裝 mariadb 服務: rpm -qa | grep mariadb 或 yum list installed | grep mariadb 如果已安裝則刪除 mariadb及其依賴的包: yum -y remove ma

LinuxMysql 5.6.30 tar安裝實踐

環境:centos 6.5 x64 再選擇 下載完畢後,得到安裝包 mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz 此包不再需要make編譯原始碼(真是扛扛的),之前的mysql-5.6.4.tar.gz包是原始碼包,需要先cmake

LinuxMySQL 5.55.6和5.7的RPM、二進位制和原始碼安裝

[[email protected] ~]# df -h Filesystem                                Size  Used Avail Use% Mounted on /dev/mapper/vg_rootlhr-Vol00              9.9

LinuxMysql 5.6.21 tar安裝實踐

好久沒玩linux,由於專案需要部署新的linux開發環境,包括安裝jdk,tomcat,redis,mysql,趁著有時間,趕緊部署好。jdk,tomcat,redis很快就部署好了,唯獨mysql讓我折騰了一陣。先安裝了我之前就安裝過的原始碼版mysql-5.6.4,後

LinuxMySQL-5.6.26 RPM安裝

1.前言 本文測試環境: CentOS release 6.4(Linux version 2.6.32-358.el6.x86_64) MySQL-5.6.26 RPM包下載地址:http://

CentOs6.5系統MySQL-5.7.19安裝

mysql5.7安裝好長時間沒有更新了,今天給大家分享一波簡單的文檔,菜鳥的入門精神就是不斷的學習,不斷地找大神幫助!!!!在這裏今天給大家推薦一個博文地址:http://sumongodb.blog.51cto.com/好了!廢話少說,幹活走起來!!!!!!!!CentOs6.5下mysql5.7.19二進