一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務(wù)器之家:專(zhuān)注于服務(wù)器技術(shù)及軟件下載分享
分類(lèi)導(dǎo)航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|數(shù)據(jù)庫(kù)技術(shù)|

服務(wù)器之家 - 數(shù)據(jù)庫(kù) - Mysql - linux二進(jìn)制通用包安裝mysql5.6.20教程

linux二進(jìn)制通用包安裝mysql5.6.20教程

2020-07-10 20:59久違的太陽(yáng) Mysql

這篇文章主要為大家詳細(xì)介紹了linux二進(jìn)制通用包安裝mysql5.6.20的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

我們使用二進(jìn)制通用包安裝MySQL,這個(gè)類(lèi)似于windows下的綠色軟件,解壓后配置即可使用,下載地址:
https://edelivery.Oracle.com/EPD/Search/handle_go

linux二進(jìn)制通用包安裝mysql5.6.20教程

2.將二進(jìn)制mysql安裝文件解壓到/usr/local下,這里使用軟連接為mysql

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@mysql1 soft]tar xvf mysql-advanced-5.6.20-linux-glibc2.5-x86_64.tar.gz -C /usr/local
[root@mysql1 local]ln -sv mysql-advanced-5.6.20-linux-glibc2.5-x86_64 mysql
[root@mysql1 local]# pwd
/usr/local
[root@mysql1 local]# ls -l
total 64
-rw-r--r--. 1 root root 20465 Aug 16 20:21 1
drwxr-xr-x. 2 root root 4096 Jun 28 2011 bin
drwxr-xr-x. 2 root root 4096 Jun 28 2011 etc
drwxr-xr-x. 2 root root 4096 Jun 28 2011 games
drwxr-xr-x. 2 root root 4096 Jun 28 2011 include
drwxr-xr-x. 2 root root 4096 Jun 28 2011 lib
drwxr-xr-x. 2 root root 4096 Jun 28 2011 lib64
drwxr-xr-x. 2 root root 4096 Jun 28 2011 libexec
lrwxrwxrwx. 1 root root 43 Aug 17 18:25 mysql -> mysql-advanced-5.6.20-linux-glibc2.5-x86_64
drwxr-xr-x. 13 root root 4096 Aug 17 18:37 mysql-advanced-5.6.20-linux-glibc2.5-x86_64
drwxr-xr-x. 2 root root 4096 Jun 28 2011 sbin
drwxr-xr-x. 5 root root 4096 Aug 16 19:14 share
drwxr-xr-x. 2 root root 4096 Jun 28 2011 src

3.添加mysql用戶(hù)和組,如果已經(jīng)存在可以跳過(guò)這一步

?
1
2
3
[root@mysql1 local]groupadd -r -g 306 mysql
#-r表示是偽用戶(hù),只是用來(lái)運(yùn)行mysql程序,不能登錄系統(tǒng)
[root@mysql1 local]useradd -g 306 -r -u 306 mysql

4.將安裝文件的所屬設(shè)置為mysql,這里將數(shù)據(jù)文件目錄設(shè)置到/mydata/data下

?
1
2
[root@mysql1 mysql]# chown -R mysql.mysql /usr/local/mysql/*
[root@mysql1 mysql]# chown -R mysql.mysql /mydata

5.初始化mysql

?
1
[root@mysql1 mysql]#scripts/mysql_install_db --user=mysql --datadir=/mydata/data/

6.在support-files目錄中將mysql.server復(fù)制到/etc/init.d中的mysqld中,創(chuàng)建初始化進(jìn)程,并且加到服務(wù)中

?
1
2
3
4
5
6
[root@mysql1 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@mysql1 mysql]# ls -l /etc/init.d/mysqld
-rwxr-xr-x. 1 root root 10880 Aug 17 18:52 /etc/init.d/mysqld
[root@mysql1 mysql]# chkconfig --add mysqld
[root@mysql1 mysql]# chkconfig --list |grep mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

7.配置mysql的配置文件

mysql的配置文件尋找順序?yàn)?etc/my.cnf -> /etc/mysql/my.cnf -> $BASEDIR/my.cnf -> ~/my.cnf 
如果存在多個(gè)配置文件,那么后者覆蓋前者,主要加上datadir為數(shù)據(jù)文件目錄位置 

?
1
2
3
4
5
6
7
8
9
[root@mysql1 support-files]# grep -v '^#' /etc/my.cnf
 
[mysqld]
 
basedir = /usr/local/mysql
datadir = /mydata/data
port = 3306
 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

8.啟動(dòng)進(jìn)入mysql

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@mysql1 support-files]# service mysqld start
Starting MySQL.  [ OK ]
[root@mysql1 support-files]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1224/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1567/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1439/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1781/master
tcp 0 0 0.0.0.0:49830 0.0.0.0:* LISTEN 1347/rpc.statd
tcp 0 0 :::111 :::* LISTEN 1224/rpcbind
tcp 0 0 :::22 :::* LISTEN 1567/sshd
tcp 0 0 ::1:631 :::* LISTEN 1439/cupsd
tcp 0 0 ::1:25 :::* LISTEN 1781/master
tcp 0 0 :::58044 :::* LISTEN 1347/rpc.statd
tcp 0 0 :::3306 :::* LISTEN 3899/mysqld

這里還需要將mysql的環(huán)境變量加到profile文件中

?
1
2
3
[root@mysql1 ~]# grep PATH .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
export PATH

可以進(jìn)入mysql了

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[root@mysql1 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.20-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
 
Copyright (c) 2000, 2014, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
 
mysql>

9.還有一些小配置

1)、添加MySQL的man幫助文檔
修改/etc/man.conf,加入相應(yīng)的配置,添加一行
MANPATH /usr/local/mysql/man
[root@mysql1 data]# vi /etc/man.config 

2)、添加mysql的庫(kù)文件

?
1
2
3
4
5
6
[root@mysql1 data]# cd /etc/ld.so.conf.d
[root@mysql1 ld.so.conf.d]# ls
atlas-x86_64.conf ctapi-x86_64.conf kernel-2.6.32-358.el6.x86_64.conf qt-x86_64.conf
[root@mysql1 ld.so.conf.d]# vi /etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib
[root@mysql1 ld.so.conf.d]# ldconfig -v

使庫(kù)文件生效

3)、添加mysql的頭文件

?
1
2
[root@mysql1 ld.so.conf.d]# ln -sv /usr/local/mysql/include /usr/include/mysql
`/usr/include/mysql/include' -> `/usr/local/mysql/include'

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 国产欧美日韩在线观看精品 | 国产真实伦对白在线播放 | 亚洲国产天堂久久精品网 | 日本另类z0zx高清 | futa文| 亚洲精品www久久久久久久软件 | 欧美性理论片在线观看片免费 | 免费看黄色一级 | 国产乱码免费卡1卡二卡3卡四 | 亚洲国产日韩欧美在线vip1区 | 国产香蕉97碰碰在线视频 | 99这里只有精品66视频 | 四虎永久在线精品波多野结衣 | 超级碰碰青草免费视频92 | 疯狂刺激的3p国产在线 | 精品欧美一区二区三区久久久 | zoomkool最新版| 小SAO货边洗澡边CAO你动漫 | 国产一区二区三区久久小说 | caonila国产在线观看 | 日韩在线视频一区二区三区 | 国产一级在线免费观看 | eeuss免费快捷 | 成人性生交大片免费看软件 | 亚洲波多野结衣日韩在线 | 色婷婷六月丁香在线观看 | 人人艹在线视频 | 欧美另类bbbxxxxx另类 | 午夜深情在线观看免费 | 99re这里只有精品视频 | 亚洲 欧美 国产 综合久久 | 极品丝袜乱系列在线阅读 | 亚洲福利天堂网福利在线观看 | 国产亚洲视频网站 | 九九精品视频在线免费观看 | 九九99热久久999精品 | 国产高清视频网站 | 国色天香社区视频免费观看3 | 国产精品麻豆99久久 | 亚洲男人天堂久久 | 欧美日本道免费一区二区三区 |