最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

linux二進制通用包安裝mysql5.6.20教程

 更新時間:2017年01月12日 09:43:42   作者:久違的太陽  
這篇文章主要為大家詳細介紹了linux二進制通用包安裝mysql5.6.20的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下

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

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

[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用戶和組,如果已經(jīng)存在可以跳過這一步

[root@mysql1 local]groupadd -r -g 306 mysql 
#-r表示是偽用戶,只是用來運行mysql程序,不能登錄系統(tǒng) 
[root@mysql1 local]useradd -g 306 -r -u 306 mysql 

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

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

5.初始化mysql

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

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

[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的配置文件尋找順序為/etc/my.cnf -> /etc/mysql/my.cnf -> $BASEDIR/my.cnf -> ~/my.cnf 
如果存在多個配置文件,那么后者覆蓋前者,主要加上datadir為數(shù)據(jù)文件目錄位置 

[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.啟動進入mysql

[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文件中

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

可以進入mysql了

[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的庫文件

[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

使庫文件生效

3)、添加mysql的頭文件

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

精彩專題分享:mysql不同版本安裝教程 mysql5.7各版本安裝教程 mysql5.6各版本安裝教程

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • linux下mysql自動備份腳本代碼

    linux下mysql自動備份腳本代碼

    mysql是以mysql用戶身份運行的,對/home /mybackup不可寫也會失敗
    2010-07-07
  • ubuntu下mysql?8.0.28 安裝配置方法圖文教程

    ubuntu下mysql?8.0.28 安裝配置方法圖文教程

    這篇文章主要為大家詳細介紹了ubuntu下mysql?8.0.28安裝配置方法圖文教程,文中安裝步驟介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-04-04
  • Centos7 移動mysql5.7.19 數(shù)據(jù)存儲位置的操作方法

    Centos7 移動mysql5.7.19 數(shù)據(jù)存儲位置的操作方法

    這篇文章主要介紹了Centos7 移動mysql5.7.19 數(shù)據(jù)存儲位置的實現(xiàn)方法,需要的朋友可以參考下
    2017-10-10
  • mysql使用instr達到in(字符串)的效果

    mysql使用instr達到in(字符串)的效果

    本文主要介紹了mysql使用instr達到in(字符串)的效果,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-04-04
  • 淺談MySQL數(shù)據(jù)庫崩潰(crash)的常見原因和解決辦法

    淺談MySQL數(shù)據(jù)庫崩潰(crash)的常見原因和解決辦法

    本文主要介紹了淺談MySQL數(shù)據(jù)庫崩潰(crash)的常見原因和解決辦法,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-03-03
  • Mysql學(xué)習(xí)之?dāng)?shù)據(jù)庫檢索語句DQL大全小白篇

    Mysql學(xué)習(xí)之?dāng)?shù)據(jù)庫檢索語句DQL大全小白篇

    這篇文章主要介紹了Mysql數(shù)據(jù)庫檢索語句DQL大全,本文適合數(shù)據(jù)庫初學(xué)者,小白也能看懂,有需要的朋友可以收藏閱讀,希望可以有所幫助
    2021-09-09
  • Mysql數(shù)據(jù)庫面試必備之三大log介紹

    Mysql數(shù)據(jù)庫面試必備之三大log介紹

    大家好,本篇文章主要講的是Mysql數(shù)據(jù)庫面試必備之三大log介紹,感興趣的同學(xué)趕快來看一看吧,對你有幫助的話記得收藏一下
    2021-12-12
  • MySQL查詢重寫插件的使用

    MySQL查詢重寫插件的使用

    這篇文章主要介紹了MySQL查詢重寫插件的使用,幫助大家更好的理解和維護數(shù)據(jù)庫,感興趣的朋友可以了解下
    2020-11-11
  • MySql?update語句的詳細用法

    MySql?update語句的詳細用法

    這篇文章主要給大家介紹了關(guān)于MySql?update語句的詳細用法,Update 是SQL中用于更新表格中已有記錄的命令,通過使用Update命令,您可以更新表格中的一行或多行記錄,并根據(jù)需要更改它們的值,需要的朋友可以參考下
    2023-11-11
  • RPM方式安裝MySQL5.6源碼

    RPM方式安裝MySQL5.6源碼

    這篇文章主要為大家分享了RPM方式安裝MySQL5.6源碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-10-10

最新評論

桑日县| 赤水市| 五华县| 水富县| 乐安县| 麟游县| 陈巴尔虎旗| 南昌县| 定远县| 阿拉善盟| 吉林省| 中西区| 土默特左旗| 墨江| 蓝山县| 万载县| 通山县| 永新县| 黄平县| 南澳县| 东阳市| 麻城市| 策勒县| 开江县| 襄汾县| 克什克腾旗| 同心县| 鸡泽县| 凤庆县| 襄樊市| 永城市| 天峻县| 浑源县| 台北市| 安吉县| 滨州市| 略阳县| 凤冈县| 乌什县| 宝兴县| 许昌县|