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

MySQL5.5 部署的一個(gè)問題

 更新時(shí)間:2020年11月11日 09:34:23   作者:AsiaYe  
這篇文章主要介紹了MySQL5.5部署的一個(gè)問題,以及解決方案,幫助大家更好的理解和使用數(shù)據(jù)庫,感興趣的朋友可以了解下

MySQL部署

     目前公司部署MySQL是通過平臺化操作的,周五的時(shí)候,平臺暫時(shí)出了點(diǎn)兒問題,手上有個(gè)需求比較著急,就直接手動的部署了一下,由于好長時(shí)間沒有部署環(huán)境了,竟然有些手生,這里把部署的步驟以及遇到的問題記錄下來,希望對大家有所幫助。

1、一般情況下,部署有三種常用的方式,第一種是yum的方式,也就是rpm包,第二種是源碼的方式,也就是source code,第三種是二進(jìn)制包,也就是tar.gz格式的包,解壓之后即可,我采用的是第三種方法,部署的MySQL版本是5.5.19版本。

2、首先來看下錯(cuò)誤吧:

啟動服務(wù)的語句:
/usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld_safe --defaults=/data/mysql_4310/my.cnf &

 [Note] InnoDB: Waiting for purge to start
 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.7.16-10 started; log sequence number 0
 [Note] Plugin 'FEDERATED' is disabled.
20190621_11:25:41mysqld: Table 'mysql.plugin' doesn't exist
 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
 [ERROR] unknown variable 'thread_concurrency=8'
 [ERROR] Aborting

    可以看到,一共報(bào)了兩個(gè)錯(cuò)誤,第一個(gè)是不能打開mysql.plugin這個(gè)表,第二個(gè)錯(cuò)誤是參數(shù)錯(cuò)誤,這個(gè)參數(shù)thread_concurrency無法識別。

    對于第二個(gè)問題,可以確認(rèn)是配置文件里面的參數(shù)問題,因?yàn)槲沂褂玫氖浅R?guī)的5.7的配置文件,改了幾個(gè)參數(shù),所以這個(gè)參數(shù)很有可能是漏改了,改掉即可。主要是第一個(gè)問題,這個(gè)時(shí)候,我進(jìn)行了下面的嘗試。

3、解決方式

嘗試1:嘗試重新啟動

使用service mysql start的方法:

[root]# service mysql_4310 start
Starting MySQL.....The server quit without updating PID fil[FAILED]/mysql_4310/tmp/mysql.pid).

發(fā)現(xiàn)服務(wù)還是無法啟動,錯(cuò)誤日志的輸出不變。

嘗試2:看到了錯(cuò)誤后面的提示,運(yùn)行mysql_upgrade方法

[root bin]# ./mysql_upgrade --protocol=tcp -P4310 -p
Enter password: 
Looking for 'mysql' as: ./mysql
Looking for 'mysqlcheck' as: ./mysqlcheck
Running 'mysqlcheck' with connection arguments: '--protocol=tcp' '--port=4310' 
./mysqlcheck: Got error: 2003: Can't connect to MySQL server on 'localhost' (111) when trying to connect

看來還是不行,這個(gè)時(shí)候我嚴(yán)重懷疑是配置文件的問題:。

嘗試3:從線上環(huán)境中搞來了一個(gè)mysql5.5的配置文件,然后重新替換新的配置文件,重新啟動:

[root@ mysql_4310]# /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld_safe --defaults-file=/data/mysql_4310/my.cnf & 
[1] 63529
[root@ mysql_4310]# 190621 11:51:37 mysqld_safe Logging to '/data/mysql_4310/log/hb30_web_wechat_answers-121_246.err'.
190621 11:51:37 mysqld_safe Starting mysqld daemon with databases from /data/mysql_4310/data
190621 11:51:40 mysqld_safe mysqld from pid file /data/mysql_4310/tmp/mysql.pid ended

查看錯(cuò)誤日志:

查看錯(cuò)誤日志:
[Note] Plugin 'FEDERATED' is disabled.
-5.5.19-linux2.6-x86_64/bin/mysqld: Unknown error 1146
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 4.0G
InnoDB: Completed initialization of buffer pool
t specified data file /data/mysql_4310/ibdata1 did not exist:
tabase to be created!
 InnoDB: Setting file /data/mysql_4310/ibdata1 size to 1000 MB
 physically writes the file full: wait...
 in MB: 100 200 300 400 500 600 700 800 900 1000
 InnoDB: Data file /data/mysql_4310/ibdata2 did not exist: new to be created
 InnoDB: Setting file /data/mysql_4310/ibdata2 size to 100 MB
 physically writes the file full: wait...
 in MB: 100
og file /data/mysql_4310/innodblog/ib_logfile0 is of different size 0 1073741824 bytes
cified in the .cnf file 0 134217728 bytes!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Aborting

發(fā)現(xiàn)最先面出現(xiàn)了新的錯(cuò)誤,提示Innodb 初始化函數(shù)返回了錯(cuò)誤,無法使用innodb存儲引擎。到這里,我開始懷疑是不是初始化的時(shí)候,就有錯(cuò)誤,導(dǎo)致服務(wù)不可用,于是想著重新初始化一遍數(shù)據(jù)字典,重新起服務(wù),看看行不行。

嘗試4:重新初始化數(shù)據(jù)字典

   嘗試使用initialize-insecure方法重新初始化,發(fā)現(xiàn)失敗了。

[root mysql_4310]# /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld
 --initialize-insecure 
--defaults-file=/data/mysql_4310/my.cnf 
--datadir=/data/mysql_4310/data 
--basedir=/usr/local/mysql-5.5.19-linux2.6-x86_64 &
[1] 7045



[1]+ Exit 2  /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld 
--initialize-insecure 
--defaults-file=/data/mysql_4310/my.cnf 
--datadir=/data/mysql_4310/data 
--basedir=/usr/local/mysql-5.5.19-linux2.6-x86_64

錯(cuò)誤日志還是之前的日志,提示mysql.plugin表不存在,除此之外,還多了一行,如下:

[ERROR] /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld: unknown option '--initialize-insecure'

于是上官方文檔上面查看了--initialize-insecure參數(shù),發(fā)現(xiàn)這個(gè)參數(shù)在mysql5.5版本沒有,然后5.5版本的是initialize參數(shù),于是換成這個(gè)initialize參數(shù),重新初始化,然后報(bào)錯(cuò)如下:

[root@ ]/usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld --defaults-file=/data/mysql_4310/my.cnf --datadir=/data/mysql_4310/data --basedir=/usr/local/mysql-5.5.19-linux2.6-x86_64 --initialize &

[1]+ Exit 2     /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld --defaults-file=/data/mysql_4310/my.cnf --datadir=/data/mysql_4310/data --basedir=/usr/local/mysql-5.5.19-linux2.6-x86_64 --initialize

此時(shí),查看官方文檔,發(fā)現(xiàn)MySQL5.5版本的初始化使用的是mysql_install_db命令而不是mysqld命令,而mysql_install_db這個(gè)工具不在/usr/local/mysql-5.5.19-linux2.6-x86_64/bin目錄中,而在/usr/local/mysql-5.5.19-linux2.6-x86_64/scripts目錄下面,于是通過cp命令將其拷貝到指定目錄,然后進(jìn)行初始化,如下:

[root@ mysql_4310]# /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysql_install_db 
--defaults-file=/data/mysql_4310/my.cnf 
[root@ mysql_4310]# ll | grep install
[root@ mysql_4310]# /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysql_install_db 
--defaults-file=/data/mysql_4310/my.cnf 
--datadir=/data/mysql_4310/data 
--basedir=/usr/local/mysql-5.5.19-linu
[1] 16365
[root@ mysql_4310]# 
Installing MySQL system tables...
OK
Filling help tables...
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:

/usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqladmin -u root -h tk01-devt-mysql-7-200 password 'new-password'

Alternatively you can run:
/usr/local/mysql-5.5.19-linux2.6-x86_64/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 /usr/local/mysql-5.5.19-linux2.6-x86_64 ; /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql-5.5.19-linux2.6-x86_64/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql-5.5.19-linux2.6-x86_64/scripts/mysqlbug script!


[1]+ Done     /usr/local/mysql-5.5.19-linux2.6-x86_64/bin/mysql_install_db --defaults-file=/data/mysql_4310/my.cnf --datadir=/data/mysql_4310/data --basedir=/usr/local/mysql-5.5.19-linux2.6-x86_64

結(jié)果成功。

總結(jié)如下:

1、MySQL5.5版本的初始化使用mysql_install_db工具,而不是mysqld工具

2、MySQL5.5版本的初始化使用--initialize參數(shù)

以上就是MySQL5.5 部署的一個(gè)問題的詳細(xì)內(nèi)容,更多關(guān)于MySQL 部署的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • 實(shí)例驗(yàn)證MySQL|update字段為相同的值是否會記錄binlog

    實(shí)例驗(yàn)證MySQL|update字段為相同的值是否會記錄binlog

    這篇文章主要介紹了實(shí)例驗(yàn)證MySQL|update字段為相同的值是否會記錄binlog,幫助大家更好的理解和學(xué)習(xí)MySQL數(shù)據(jù)庫,感興趣的朋友可以了解下
    2020-10-10
  • mac安裝mysql數(shù)據(jù)庫及配置環(huán)境變量的圖文教程

    mac安裝mysql數(shù)據(jù)庫及配置環(huán)境變量的圖文教程

    本文主要介紹了mac安裝mysql數(shù)據(jù)庫及配置環(huán)境變量,文中通過圖文代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-08-08
  • 詳解MySQL中WHERE子句的用法

    詳解MySQL中WHERE子句的用法

    這篇文章主要介紹了詳解MySQL中WHERE子句的用法,是MySQL入門學(xué)習(xí)中的基礎(chǔ)知識,需要的朋友可以參考下
    2015-05-05
  • MySQL定位長事務(wù)(Identify Long Transactions)的實(shí)現(xiàn)

    MySQL定位長事務(wù)(Identify Long Transactions)的實(shí)現(xiàn)

    在MySQL的運(yùn)行中,經(jīng)常會遇到一些長事務(wù),本文主要介紹了MySQL定位長事務(wù),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-09-09
  • MySQL中使用SHOW PROFILE命令分析性能的用法整理

    MySQL中使用SHOW PROFILE命令分析性能的用法整理

    這篇文章主要介紹了MySQL中使用show profile命令分析性能的用法整理,show profiles是數(shù)據(jù)庫性能優(yōu)化的常用命令,需要的朋友可以參考下
    2015-11-11
  • mysql 8.0.14 安裝配置方法圖文教程

    mysql 8.0.14 安裝配置方法圖文教程

    這篇文章主要為大家詳細(xì)介紹了mysql 8.0.14 安裝配置方法圖文教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-02-02
  • MySQL如何使用union all獲得并集排序

    MySQL如何使用union all獲得并集排序

    這篇文章主要介紹了MySQL如何使用union all獲得并集排序,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-03-03
  • Docker Dockerfile構(gòu)建MySQL并初始化數(shù)據(jù)方式

    Docker Dockerfile構(gòu)建MySQL并初始化數(shù)據(jù)方式

    這篇文章主要介紹了Docker Dockerfile構(gòu)建MySQL并初始化數(shù)據(jù)方式,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-04-04
  • MySQL安裝時(shí)一直卡在starting?server的問題及解決方法

    MySQL安裝時(shí)一直卡在starting?server的問題及解決方法

    這篇文章主要介紹了MySQL安裝時(shí)一直卡在starting?server的問題及解決方法,出現(xiàn)這種情況大概有兩個(gè)原因,文中對每種原因給大家詳細(xì)介紹,需要的朋友可以參考下
    2022-06-06
  • mysql查詢鎖表方式

    mysql查詢鎖表方式

    在MySQL中,查詢鎖表可以通過多個(gè)命令實(shí)現(xiàn),如show?engine?innodb?status、show?processlist等,用以檢測和解決表鎖問題,首先通過show?engine?innodb?status查看鎖表情況,接著利用show?processlist找出長時(shí)間占用的SQL語句
    2024-09-09

最新評論

黔南| 宿松县| 哈密市| 崇明县| 兴山县| 隆安县| 临夏市| 北票市| 天镇县| 专栏| 十堰市| 大安市| 洪雅县| 文成县| 赤城县| 横峰县| 禄丰县| 监利县| 新平| 武城县| 体育| 讷河市| 周口市| 铜梁县| 汉中市| 红桥区| 郓城县| 柳江县| 郑州市| 龙南县| 松滋市| 长乐市| 长武县| 阜南县| 商丘市| 荥阳市| 塔河县| 凤翔县| 禄丰县| 大姚县| 巢湖市|