1. 程式人生 > >Mysql tar.gz 包安裝過程

Mysql tar.gz 包安裝過程

從官網下載mysql-5..-linux-glibc2.5-x86_64.tar.gz

建立mysql使用者

[root@Master home]# useradd mysql
[root@Master data]# echo 'mysql'|passwd --stdin mysql

更改使用者 mysql 的密碼 。
passwd: 所有的身份驗證令牌已經成功更新。

在mysql使用者下建立data目錄並解壓

[root@Master data]# tar -zxvf mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
[root@Master data]# mv mysql-5.6.12-linux-glibc2.5-x86_64 mysql //重新命名

設定許可權

[root@Master data]# chown -R mysql:mysql mysql

切換使用者並進入mysql/scripts 目錄

[root@Master data]# su mysql
[mysql@Master data]$ cd mysql/scripts/
[mysql@Master scripts]$

安裝(目錄根據自己的mysql解壓目錄自行設定)

[mysql@Master scripts]$ ./mysql_install_db --user=mysql --basedir=/home/mysql/data/mysql --datadir=/home/mysql
/data/mysql/data

輸出資訊:

Installing MySQL system tables...2016-08-30 19:55:41 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-30 19:55:42 1354 [Warning] Buffered warning: Changed limits: max_open_files: 1024
(requested 5000) 2016-08-30 19:55:42 1354 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000) 2016-08-30 19:55:42 1354 [Note] InnoDB: The InnoDB memory heap is disabled 2016-08-30 19:55:42 1354 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2016-08-30 19:55:42 1354 [Note] InnoDB: Compressed tables use zlib 1.2.3 2016-08-30 19:55:42 1354 [Note] InnoDB: Using Linux native AIO 2016-08-30 19:55:42 1354 [Note] InnoDB: Not using CPU crc32 instructions 2016-08-30 19:55:42 1354 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2016-08-30 19:55:42 1354 [Note] InnoDB: Completed initialization of buffer pool 2016-08-30 19:55:42 1354 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! 2016-08-30 19:55:42 1354 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB 2016-08-30 19:55:42 1354 [Note] InnoDB: Database physically writes the file full: wait... 2016-08-30 19:55:42 1354 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 2016-08-30 19:55:43 1354 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 2016-08-30 19:55:44 1354 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 2016-08-30 19:55:44 1354 [Warning] InnoDB: New log files created, LSN=45781 2016-08-30 19:55:44 1354 [Note] InnoDB: Doublewrite buffer not found: creating new 2016-08-30 19:55:44 1354 [Note] InnoDB: Doublewrite buffer created 2016-08-30 19:55:44 1354 [Note] InnoDB: 128 rollback segment(s) are active. 2016-08-30 19:55:44 1354 [Warning] InnoDB: Creating foreign key constraint system tables. 2016-08-30 19:55:44 1354 [Note] InnoDB: Foreign key constraint system tables created 2016-08-30 19:55:44 1354 [Note] InnoDB: Creating tablespace and datafile system tables. 2016-08-30 19:55:44 1354 [Note] InnoDB: Tablespace and datafile system tables created. 2016-08-30 19:55:44 1354 [Note] InnoDB: Waiting for purge to start 2016-08-30 19:55:44 1354 [Note] InnoDB: 5.6.12 started; log sequence number 0 2016-08-30 19:55:44 1354 [Note] Binlog end 2016-08-30 19:55:44 1354 [Note] InnoDB: FTS optimize thread exiting. 2016-08-30 19:55:44 1354 [Note] InnoDB: Starting shutdown... 2016-08-30 19:55:46 1354 [Note] InnoDB: Shutdown completed; log sequence number 1625977 OK Filling help tables...2016-08-30 19:55:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-08-30 19:55:46 1377 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000) 2016-08-30 19:55:46 1377 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000) 2016-08-30 19:55:46 1377 [Note] InnoDB: The InnoDB memory heap is disabled 2016-08-30 19:55:46 1377 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2016-08-30 19:55:46 1377 [Note] InnoDB: Compressed tables use zlib 1.2.3 2016-08-30 19:55:46 1377 [Note] InnoDB: Using Linux native AIO 2016-08-30 19:55:46 1377 [Note] InnoDB: Not using CPU crc32 instructions 2016-08-30 19:55:46 1377 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2016-08-30 19:55:46 1377 [Note] InnoDB: Completed initialization of buffer pool 2016-08-30 19:55:46 1377 [Note] InnoDB: Highest supported file format is Barracuda. 2016-08-30 19:55:46 1377 [Note] InnoDB: 128 rollback segment(s) are active. 2016-08-30 19:55:46 1377 [Note] InnoDB: Waiting for purge to start 2016-08-30 19:55:46 1377 [Note] InnoDB: 5.6.12 started; log sequence number 1625977 2016-08-30 19:55:46 1377 [Note] Binlog end 2016-08-30 19:55:46 1377 [Note] InnoDB: FTS optimize thread exiting. 2016-08-30 19:55:46 1377 [Note] InnoDB: Starting shutdown... 2016-08-30 19:55:48 1377 [Note] InnoDB: Shutdown completed; log sequence number 1625987 OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /home/mysql/data/mysql/bin/mysqladmin -u root password 'new-password' /home/mysql/data/mysql/bin/mysqladmin -u root -h Master.Hadoop password 'new-password' Alternatively you can run: /home/mysql/data/mysql/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd . ; /home/mysql/data/mysql/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems with the ./bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com New default config file was created as /home/mysql/data/mysql/my.cnf and will be used by default by the server when you start it. You may edit this file to change server settings WARNING: Default config file /etc/my.cnf exists on the system This file will be read by default by the MySQL server If you do not want to use this, either remove it, or use the --defaults-file argument to mysqld_safe when starting the server

配置檔案

[mysql@Master scripts]$ cd ../support-files/
[root@Master support-files]# cp my-default.cnf /etc/my.cnf
[root@Master support-files]# cp mysql.server /etc/init.d/mysql
[root@Master support-files]# vim /etc/init.d/mysql //修改mysql檔案

新增以下兩行

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

配置環境變數

[root@Master support-files]# vim /etc/profile
#set mysql environment
export MYSQL_HOME=/home/mysql/data/mysql
export PATH=$MYSQL_HOME/bin:$PATH
source /etc/profile

配置mysql服務開機自動啟動

[root@Master bin]# chkconfig --add mysql //新增mysql
[root@Master bin]# chkconfig mysql on //設定開機啟動

啟動mysql

[root@Master support-files]# service mysql start
env: /etc/init.d/mysql: 許可權不夠 //如果出現這個提示 執行以下命令重新啟動
[root@Master support-files]# chmod a+wrx /etc/init.d/mysql
[root@Master support-files]# service mysql start
Starting MySQL.. SUCCESS! //啟動成功

設定root登入密碼

[[email protected] ~]# cd /home/mysql/data/mysql/bin/ //進去mysql的bin目錄
[[email protected] bin]# ./mysqladmin -u root password 'password' //'password' 為自己設定的密碼引號非必須
[[email protected] bin]# ./mysqladmin -u root password mysql
[[email protected] bin]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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 tar.gz 安裝過程

從官網下載mysql-5..-linux-glibc2.5-x86_64.tar.gz 建立mysql使用者 [root@Master home]# useradd mysql [root@Master data]# echo 'mysql'|passwd

Centos系統通過tar.gz安裝Mysql5.7

light 修改 class ads basedir 創建 datadir 遠程 root 1.安裝mysql之前需要確保系統中有libaio依賴,使用如下命令: yum search libaio yum install libaio 2.進入centos終端操作

怎樣從Mysql官網下載mysql.tar.gz版本的安裝

      今天學習在Linux上部署專案,用到了Mysql,因此想要下載適用於Linux的安裝版本,在Mysql官網找了半天,終於找到怎樣下載了,這裡寫出來,以後大家找的時候就好找了。 第一步:在百

【札記】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

Python_安裝官方whltar.gz

bsp tar.gz 安裝 pytho fig configure whl 環境 all Windows環境:   安裝whl包:pip install wheel -> pip install **.whl   安裝tar.gz包:cd到解壓後路徑,p

linux 下安裝 tar.gz

1)解壓tar.gz包  “tar –xvzf 軟體包名”,就可以完成解壓與解包工作。  “tar -zxvf 軟體包名.tar.gz -C /home/hao”   解壓到指定的目錄下 (注意:-C為大寫) 2)進入解壓後的檔案目錄下 執行“./configure”命

Centos6.5 + mysql-5.6.14.tar.gz 編譯安裝教程

一解除安裝舊版本:    使用下面的命令檢查是否安裝有MySQL Server    rpm-qa | grep mysql 有的話通過下面的命令來解除安裝掉 rpm -e --nodeps mysql    //

Linux安裝JDK Tomcat MySQL - - - tar.gz

本文教程 安裝jdk -> 安裝tomcat -> mysql 本文所有安裝包均為在官網下載 且都為.tar.gz格式 安裝路徑都為/usr/local/自定義資料夾/程式名中 Linux安裝JDK Linux預設自帶jdk 檢查Linux中自帶jdk版本

linux CenterOS 下 mysql-5.6.26.tar.gz原始碼安裝

1.準備工作 [[email protected]]# cd /cnpc/ 百度雲盤 mysql-5.6.26.tar.gz連結:http://pan.baidu.com/s/1dDe9ifv 密碼:ifus [[email protected] cn

Centos6.5 + mysql-5.6.14.tar.gz 編譯安裝教程

一解除安裝舊版本:    使用下面的命令檢查是否安裝有MySQL Server    rpm-qa | grep mysql 有的話通過下面的命令來解除安裝掉 rpm -e --nodeps mysql    // 強力刪除模式 二安裝Mysql    安裝編譯程式碼需要的

以root身份mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz安裝

一、解壓檔案tar -zxvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gzmv mysql-5.7.17-linux-glibc2.5-x86_64/*  /usr/local/mysql/ 二、建立data目錄mkdir -p /us

elk的tar.gz安裝

elk在安裝ELK的過程中有些問題。安裝elasticsearch和kibana直接使用系統啟動腳本,加入系統啟動。安裝logstash的時候使用system-install文件來生成系統啟動腳本。在各種使用中的問題只能查看日誌文件找出問題的出現,解決之。elk的tar.gz的安裝

mysql 5.7最新安裝過程以及添加環境變量

mysql 5.7 環境變量本文出自 “大李子” 博客,謝絕轉載!mysql 5.7最新安裝過程以及添加環境變量

數據庫自動備份並打成tar.gz

span vars color 備份 bsp tar info pan path #!/bin/sh # database info db_user="user" db_pass="pass" db_host="127.0.0.1" db_name="dbname"

linux中用vim命令修改.tar.gz和.zip命令的內容

rgb idt linux中 server tar.gz 強制 spa -s webapps 在實際生產環境中將程序打包部署到linux上或者在linux上更新程序時,很多時候都要修改.zip包或者.tar.gz包中的配置文件的內容,如果在本機和linux上進行包程

java,maven工程打tar.gz執行main方法

sport desc pre remote without pil deploy can 周期 一,需要在pom.xml文件添加plugin, 項目目錄結構 1 <build> 2 <plugins> 3 4

mysql-源碼安裝

安裝 pil IT ali pro p s add lib include 源碼包安裝mysql: 1、下載源碼包 www.mysql.com # md5sum mysql-5.6.25.tar.gz 37664399c91021abe070faa700ecd0ed mys

Mysql使用壓縮安裝小貼士

enc 服務 for dir order mark 初始 forum xtra 官方安裝指導說明書: https://dev.mysql.com/doc/refman/8.0/en/windows-install-archive.html Extract the mai

caffe依賴安裝過程

caffe依賴包的安裝  1 安裝protobuf $ tar zxvf protobuf-2.5.0.tar.gz $ cd protobuf-2.5.0 $ ./configure --prefix=/home/liu/local_install/ $ make $

apk安裝安裝過程中出錯 Failure INSTALL_FAILED_CONFLICTING_PROVIDER

在給測試手機安裝正式版本的過程中,出現了錯誤。 因為之前安裝了debug版本,我把debug包解除安裝了後,用adb命令安裝,出現了以下的錯誤: adb: failed to install xxxx.apk: Failure [INSTALL_FAILED_CONFLICTING_PROV