av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁技術文章
文章詳情頁

MySQL5.5 部署的一個問題

瀏覽:5日期:2023-10-09 14:25:38

MySQL部署

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

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

2、首先來看下錯誤吧:

啟動服務的語句:/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

可以看到,一共報了兩個錯誤,第一個是不能打開mysql.plugin這個表,第二個錯誤是參數錯誤,這個參數thread_concurrency無法識別。

對于第二個問題,可以確認是配置文件里面的參數問題,因為我使用的是常規的5.7的配置文件,改了幾個參數,所以這個參數很有可能是漏改了,改掉即可。主要是第一個問題,這個時候,我進行了下面的嘗試。

3、解決方式

嘗試1:嘗試重新啟動

使用service mysql start的方法:

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

發現服務還是無法啟動,錯誤日志的輸出不變。

嘗試2:看到了錯誤后面的提示,運行mysql_upgrade方法

[root bin]# ./mysql_upgrade --protocol=tcp -P4310 -pEnter password: Looking for ’mysql’ as: ./mysqlLooking for ’mysqlcheck’ as: ./mysqlcheckRunning ’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

看來還是不行,這個時候我嚴重懷疑是配置文件的問題:。

嘗試3:從線上環境中搞來了一個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/data190621 11:51:40 mysqld_safe mysqld from pid file /data/mysql_4310/tmp/mysql.pid ended

查看錯誤日志:

查看錯誤日志:[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 disabledInnoDB: Mutexes and rw_locks use GCC atomic builtinsInnoDB: Compressed tables use zlib 1.2.3InnoDB: Using Linux native AIOInnoDB: Initializing buffer pool, size = 4.0GInnoDB: Completed initialization of buffer poolt 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: 100og file /data/mysql_4310/innodblog/ib_logfile0 is of different size 0 1073741824 bytescified 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

發現最先面出現了新的錯誤,提示Innodb 初始化函數返回了錯誤,無法使用innodb存儲引擎。到這里,我開始懷疑是不是初始化的時候,就有錯誤,導致服務不可用,于是想著重新初始化一遍數據字典,重新起服務,看看行不行。

嘗試4:重新初始化數據字典

嘗試使用initialize-insecure方法重新初始化,發現失敗了。

[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

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

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

于是上官方文檔上面查看了--initialize-insecure參數,發現這個參數在mysql5.5版本沒有,然后5.5版本的是initialize參數,于是換成這個initialize參數,重新初始化,然后報錯如下:

[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

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

[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...OKFilling help tables...OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE 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_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly 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.plcd /usr/local/mysql-5.5.19-linux2.6-x86_64/mysql-test ; perl mysql-test-run.plPlease 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

結果成功。

總結如下:

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

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

以上就是MySQL5.5 部署的一個問題的詳細內容,更多關于MySQL 部署的資料請關注好吧啦網其它相關文章!

標簽: MySQL 數據庫
相關文章:
主站蜘蛛池模板: 色综合久久88色综合天天 | 国产剧情一区二区三区 | aa级毛片毛片免费观看久 | 久久精品视频免费看 | 久久99蜜桃综合影院免费观看 | 毛片毛片毛片毛片毛片 | www国产成人免费观看视频,深夜成人网 | 高清视频一区二区三区 | 日韩av.com| 九九久久久 | 国产日韩免费视频 | 日韩电影一区二区三区 | 国产精品1 | 国产精品精品视频一区二区三区 | 亚洲精品中文字幕 | 欧美一级电影免费 | 91亚洲国产成人精品一区二三 | 亚洲一区有码 | 精品国产不卡一区二区三区 | 国产精品美女久久久久aⅴ国产馆 | 欧美日韩一区在线 | 成人性视频免费网站 | 97高清国语自产拍 | 国内自拍视频在线观看 | 久久久精 | 午夜精品视频在线观看 | 国产成人jvid在线播放 | 综合色导航 | 国产亚洲网站 | 精品国产一区二区三区久久 | 91免费视频观看 | 亚洲精品视频导航 | 亚洲视频在线观看 | 亚洲精品一区中文字幕乱码 | jizz在线看片 | 91视频久久 | 国产视频三区 | 久久免费精品视频 | 欧美一级片在线看 | 中文字幕在线中文 | 久久久精品影院 |