二進位制方式安裝mysql 5.6.15
1 環境介紹
作業系統:Red Hat Enterprise Linux Server release 5.6 (64位)
2 安裝軟體
二進位制包:mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz
Mysql 下載地址:http://dev.mysql.com/downloads/
3 安裝步驟
3.1 建立使用者
[root@laodeng5 /]# groupadd mysql
[root@laodeng5 /]# useradd -m -r -g mysql mysql
3.2 建立目錄
[root@laodeng5 /]# mkdir /opt
3.3 解壓
[root@laodeng5 /]# cd /opt
[root@laodeng5 opt]# tar -xzvf /software/mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz
[root@laodeng5 opt]# rename mysql-5.6.15-linux-glibc2.5-x86_64 to mysql
[root@laodeng5 opt]# cd mysql
[root@laodeng5 mysql]# chown -R mysql .
[root@laodeng5 mysql]# chgrp -R mysql .
3.4 安裝資料庫
[root@laodeng5 mysql]# scripts/mysql_install_db --user=mysql --user=mysql --basedir=/opt/mysql/ --datadir=/opt/mysql/data/
Installing MySQL system tables...2014-01-27 11:00:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-01-27 11:00:24 26220 [Note] InnoDB: The InnoDB memory heap is disabled
2014-01-27 11:00:24 26220 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-01-27 11:00:24 26220 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-01-27 11:00:24 26220 [Note] InnoDB: Using Linux native AIO
2014-01-27 11:00:24 26220 [Note] InnoDB: Using CPU crc32 instructions
2014-01-27 11:00:24 26220 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-01-27 11:00:24 26220 [Note] InnoDB: Completed initialization of buffer pool
2014-01-27 11:00:24 26220 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-01-27 11:00:24 26220 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-01-27 11:00:24 26220 [Note] InnoDB: Database physically writes the file full: wait...
2014-01-27 11:00:24 26220 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-01-27 11:00:25 26220 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-01-27 11:00:25 26220 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-01-27 11:00:25 26220 [Warning] InnoDB: New log files created, LSN=45781
2014-01-27 11:00:25 26220 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-01-27 11:00:25 26220 [Note] InnoDB: Doublewrite buffer created
2014-01-27 11:00:25 26220 [Note] InnoDB: 128 rollback segment(s) are active.
2014-01-27 11:00:26 26220 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-01-27 11:00:26 26220 [Note] InnoDB: Foreign key constraint system tables created
2014-01-27 11:00:26 26220 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-01-27 11:00:26 26220 [Note] InnoDB: Tablespace and datafile system tables created.
2014-01-27 11:00:26 26220 [Note] InnoDB: Waiting for purge to start
2014-01-27 11:00:26 26220 [Note] InnoDB: 5.6.15 started; log sequence number 0
2014-01-27 11:00:26 26220 [Note] Binlog end
2014-01-27 11:00:26 26220 [Note] InnoDB: FTS optimize thread exiting.
2014-01-27 11:00:26 26220 [Note] InnoDB: Starting shutdown...
2014-01-27 11:00:28 26220 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK
Filling help tables...2014-01-27 11:00:28 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-01-27 11:00:28 26243 [Note] InnoDB: The InnoDB memory heap is disabled
2014-01-27 11:00:28 26243 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-01-27 11:00:28 26243 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-01-27 11:00:28 26243 [Note] InnoDB: Using Linux native AIO
2014-01-27 11:00:28 26243 [Note] InnoDB: Using CPU crc32 instructions
2014-01-27 11:00:28 26243 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-01-27 11:00:28 26243 [Note] InnoDB: Completed initialization of buffer pool
2014-01-27 11:00:28 26243 [Note] InnoDB: Highest supported file format is Barracuda.
2014-01-27 11:00:28 26243 [Note] InnoDB: 128 rollback segment(s) are active.
2014-01-27 11:00:28 26243 [Note] InnoDB: Waiting for purge to start
2014-01-27 11:00:28 26243 [Note] InnoDB: 5.6.15 started; log sequence number 1625977
2014-01-27 11:00:28 26243 [Note] Binlog end
2014-01-27 11:00:28 26243 [Note] InnoDB: FTS optimize thread exiting.
2014-01-27 11:00:28 26243 [Note] InnoDB: Starting shutdown...
2014-01-27 11:00:29 26243 [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:
/opt/mysql//bin/mysqladmin -u root password 'new-password'
/opt/mysql//bin/mysqladmin -u root -h laodeng5.localdomain password 'new-password'
Alternatively you can run:
/opt/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 . ; /opt/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
Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /opt/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
[root@laodeng5 mysql]# chown -R root .
[root@laodeng5 mysql]# chown -R mysql data
3.5 配置資料庫
[root@laodeng5 mysql]# mkdir etc
[root@laodeng5 mysql]# mkdir log
[root@laodeng5 mysql]# chown mysql log
[root@laodeng5 mysql]# cp support-files/mysql.server /etc/init.d/
修改密碼:
[root@laodeng5 mysql]# bin/mysqladmin -u root password 'mysql'
為了能夠service mysql.server start的方式啟動mysql,進行如下配置:
方法一:
[root@laodeng5 mysql]# ln –s /opt/mysql /usr/local/mysql
[root@laodeng5 mysql]# cp support-files/my-default.cnf etc/my.cnf
方法二:
[root@laodeng5 mysql]# cd /ect/init.d
[root@laodeng5 init.d]# vi mysql.server
修改:
basedir=
datadir=
為
basedir=/opt/mysql
datadir=/opt/mysql/data
[root@laodeng5 init.d]# cd /opt/mysql
[root@laodeng5 mysql]# cp support-files/my-default.cnf /etc/my.cnf
注意:兩種方法的my.cnf位置不同。
可以使用如下命令檢視mysql搜尋my.cnf配置檔案的順序:
[root@laodeng5 mysql]# bin/mysqld --help --verbose --skip-networking --pid-file=$(tempfile) 2> /dev/null | grep -A1 'Default options are read'
-bash: tempfile: command not found
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/195110/viewspace-1075931/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Windows11二進位制方式安裝MySQL5.7.44WindowsMySql
- 【Linux合集】二進位制安裝mysqlLinuxMySql
- Mysql for Linux安裝配置之——二進位制安裝MySqlLinux
- RHEL 7.2 安裝二進位制MySQL 5.7.18MySql
- centos 7 二進位制安裝mysql 5.7.25CentOSMySql
- Ubuntu 24.04 二進位制安裝 MySQL 8.0.20UbuntuMySql
- centos7二進位制方式安裝rabbitmqCentOSMQ
- 二進位制方式安裝 k8sK8S
- mysql5.7 for windows二進位制安裝及配置MySqlWindows
- CentOS7 安裝 MySQL8.0(二進位制)CentOSMySql
- PostgreSQL二進位制安裝流程SQL
- PostgreSQL 10.23 二進位制安裝SQL
- 二進位制檔案安裝安裝etcd
- Ubuntu24 二進位制包安裝mysql5.7UbuntuMySql
- CentOS6.5二進位制檔案安裝MySQL5.6.39CentOSMySql
- 基於Linux的MySQL5.7的二進位制安裝LinuxMySql
- Kubernetes部署-二進位制方式
- Linux安裝二進位制PHP7.2LinuxPHP
- 二進位制安裝 Docker 以及 Docker ComposeDocker
- 03二進位制包安裝與介紹
- MySQL二進位制檔案(binlog)MySql
- 【ubuntu】使用二進位制安裝包安裝node和npm並配置UbuntuNPM
- 基於LINUX的MySql二進位制本地安裝和部署實施測試LinuxMySql
- 二進位制與二進位制運算
- 進位制詳解:二進位制、八進位制和十六進位制
- Postgresql13.1-1 win10二進位制安裝SQLWin10
- 二進位制方式解決 power 問題
- JavaScript 二進位制、八進位制與十六進位制JavaScript
- MySQL 壓縮二進位制日誌MySql
- mysql 二進位制日誌總結MySql
- 二進位制
- (二進位制)
- 十進位制——二 (八、十六 )進位制
- 二進位制,八進位制,十進位制,十六進位制的相互轉換
- 二進位制安裝Kubernetes(k8s)v1.28.3K8S
- 二進位制安裝Kubernetes(k8s)v1.30.1K8S
- 二進位制安裝Kubernetes(k8s)v1.31.1K8S
- window環境的openssl二進位制發行版安裝
- 【進位制轉換】二進位制、十六進位制、十進位制、八進位制對應關係