婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > mysql 8.0.18 安裝配置方法圖文教程(linux)

mysql 8.0.18 安裝配置方法圖文教程(linux)

熱門標簽:常州網絡外呼系統開發 安徽ai電話電銷機器人有效果嗎 400電話申請信用卡 萊西市地圖標注 外呼系統電銷受騙 在哪里申請400電話 銷售語音電話機器人 巫師三血與酒地圖標注 走過哪個省地圖標注

本文記錄了linux mysql 8.0.18 安裝配置圖文教程,供大家參考,具體內容如下

1、官網安裝包下載地址

2、我這里通過xftp將安裝包上傳至Linux服務器

3.解壓

解壓命令:tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar

繼續解壓需要的那一個

命令: tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz

重命名并移動到合適的路徑

重命名 : mv mysql-8.0.18-linux-glibc2.12-x86_64 mysql

移動:


4.在/usr/local/mysql下創建data文件夾

# mkdir data

5.初始化數據庫,自動生成密碼 需記錄 等下要用

# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

ps:中間遇到一個坑,初始化數據庫時候報了錯

具體錯誤為:bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

解決方法為:yum install libaio-devel.x86_64 原因是缺少了libaio這個東西 安裝就完事了

再次執行初始化命令

得到初始化密碼,需要記下,一會會用到

6.修改/usr/local/mysql 當前目錄的用戶

# chown -R root:root ./
# chown -R mysql:mysql data

7.復制my-default.cnf這個文件到etc/my.cnf去

具體命令為:

# cd support-files/
# touch my-default.cnf
# chmod 777 ./my-default.cnf 
# cd ../
# cp support-files/my-default.cnf /etc/my.cnf

8.完了之后配置my.cnf

vim /etc/my.cnf

內容:

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /tmp/mysql.sock
log-error = /usr/local/mysql/data/error.log
pid-file = /usr/local/mysql/data/mysql.pid
tmpdir = /tmp
port = 5186
#lower_case_table_names = 1
# server_id = .....
# socket = .....
#lower_case_table_names = 1
max_allowed_packet=32M
default-authentication-plugin = mysql_native_password
#lower_case_file_system = on
#lower_case_table_names = 1
log_bin_trust_function_creators = ON
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

如果后期mysql運行報錯,可以直接到log-error = /usr/local/mysql/data/error.log目錄下直接查看錯誤日志

命令:cat /usr/local/mysql/data/error.log

9.開機自啟,進入/usr/local/mysql/support-files進行設置

# cd support-files/
# cp mysql.server /etc/init.d/mysql 
# chmod +x /etc/init.d/mysql

10.注冊服務

# chkconfig --add mysql

11.查看是否成功

12.etc/ld.so.conf要配置路徑,不然報錯

# vim /etc/ld.so.conf

添加如下內容:

/usr/local/mysql/lib

13.配置環境變量

# vim /etc/profile
# source /etc/profile

添加如下內容:

#MYSQL ENVIRONMENT
export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib

14.登錄 需要用到上面的生成的密碼

#啟動mysql服務
[root@localhost bin]# service mysql start
Starting MySQL.Logging to '/usr/local/mysql/data/error.log'.
.. SUCCESS! 
[root@localhost bin]# 
 
#修改mysql密碼
mysql> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.02 sec)
mysql> 

ps:第二個坑,在啟動時出現錯誤 詳情為:
Starting MySQL...The server quit without updating PID file [FAILED]cal/mysql/data/mysql.pid).

該錯誤翻了一下午,繞了一大圈,最終問題是my.cnf文件配置問題,千萬不能以為加了#就是注釋掉了,自己檢查了n遍,覺得沒有錯,結果就是不行,沒有辦法找了一份另一臺服務器的my.cnf配置,復制替換稍加修改,解決問題。

大功告成!可以使用可視化工具進行數據庫連接了。

安裝完成。

精彩專題分享:

mysql不同版本安裝教程

mysql5.7各版本安裝教程

mysql5.6各版本安裝教程

mysql8.0各版本安裝教程

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

您可能感興趣的文章:
  • linux 安裝 mysql 8.0.19 詳細步驟及問題解決方法
  • Linux系統MySQL8.0.19快速安裝配置教程圖解
  • linux(Centos7)下安裝mysql8.0.18的教程圖解
  • mysql-5.7.28 在Linux下的安裝教程圖解
  • linux環境下安裝mysql數據庫的詳細教程

標簽:鞍山 赤峰 果洛 陽江 來賓 煙臺 河北 黃石

巨人網絡通訊聲明:本文標題《mysql 8.0.18 安裝配置方法圖文教程(linux)》,本文關鍵詞  mysql,8.0.18,安裝,配置,方法,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《mysql 8.0.18 安裝配置方法圖文教程(linux)》相關的同類信息!
  • 本頁收集關于mysql 8.0.18 安裝配置方法圖文教程(linux)的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 凤翔县| 固安县| 汽车| 垣曲县| 龙陵县| 怀宁县| 太和县| 沾益县| 霍邱县| 卢湾区| 忻城县| 石门县| 华阴市| 泸州市| 景德镇市| 赣州市| 崇信县| 牡丹江市| 辛集市| 新闻| 达拉特旗| 新干县| 宝应县| 鲜城| 西畴县| 阳泉市| 唐河县| 六盘水市| 巧家县| 高要市| 临澧县| 莱州市| 广平县| 神农架林区| 镇坪县| 洞头县| 苍山县| 调兵山市| 浦县| 秦皇岛市| 绥宁县|