久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

CentOS7安裝MySQL5.6遇到的問(wèn)題怎么解決

共計(jì) 9943 個(gè)字符,預(yù)計(jì)需要花費(fèi) 25 分鐘才能閱讀完成。

這篇文章主要介紹“CentOS7 安裝 MySQL5.6 遇到的問(wèn)題怎么解決”,在日常操作中,相信很多人在 CentOS7 安裝 MySQL5.6 遇到的問(wèn)題怎么解決問(wèn)題上存在疑惑,丸趣 TV 小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”CentOS7 安裝 MySQL5.6 遇到的問(wèn)題怎么解決”的疑惑有所幫助!接下來(lái),請(qǐng)跟著丸趣 TV 小編一起來(lái)學(xué)習(xí)吧!

在一測(cè)試服務(wù)器(centos linux release 7.2.1511)上安裝 mysql 5.6(5.6.19 mysql community server)時(shí)遇到下面錯(cuò)誤,這個(gè)是因?yàn)?centos 7 的默認(rèn)數(shù)據(jù)庫(kù)已經(jīng)不再是 mysql 了,而是 mariadb. mysql 安裝時(shí)的 mysql lib 庫(kù)與 mariadb 的庫(kù)、包沖突了,如下詳情所示(省略了大量日志)

[root@azrlnx06 tmp]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
file /usr/share/mysql/czech/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/french/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/german/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
........................................................................................................................................................................
file /usr/share/mysql/charsets/macroman.xml from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64

檢查是否存在 mariadb 的相關(guān)組件, 然后刪除 mariadb 相關(guān)組件。如下所示:

[root@azrlnx06 mysql]# more /etc/redhat-release 
centos linux release 7.2.1511 (core) 
[root@azrlnx06 mysql]# rpm -qa |grep mariadb
mariadb-libs-5.5.50-1.el7_2.x86_64
[root@azrlnx06 mysql]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64
error: failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
[root@azrlnx06 mysql]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64 --nodeps

當(dāng)然此處刪除 mariadb-libs-5.5.50-1.el7_2.x86_64 組件時(shí)遇到依賴錯(cuò)誤,遂強(qiáng)制刪除該組件,最好使用 yum 刪除 mariadb 相關(guān)組件。然后重新安裝 mysql 時(shí)遇到 error: mysql-server-advanced-5.6.20-1.rhel5.x86_64: install failed 錯(cuò)誤,如下所示:

[root@azrlnx06 mysql]# cd /tmp
[root@azrlnx06 tmp]# ls
hsperfdata_azrlnx06 jirasetup mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm
[root@azrlnx06 tmp]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-server-advanced-5.6.20-1.rh################################# [100%]
error: unpacking of archive failed on file /usr/bin/innochecksum;582535c8: cpio: read failed - no such file or directory
error: mysql-server-advanced-5.6.20-1.rhel5.x86_64: install failed
[root@azrlnx06 tmp]# 
clip_image001

對(duì)這個(gè)錯(cuò)誤有點(diǎn)莫名其妙,卸載 mysql 相關(guān)組件后,重新安裝 mysql,發(fā)現(xiàn)缺少 perl 相關(guān)模組。如下所示:

[root@azrlnx06 jirasetup]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-server-advanced-5.6.20-1.rh################################# [100%]
fatal error: please install the following perl modules before executing /usr/bin/mysql_install_db:
data::dumper
[root@azrlnx06 jirasetup]#

使用 yum 安裝了 perl perl-devel 相關(guān)包(注意:此處安裝 mysql 時(shí),沒(méi)有輸出安裝相關(guān) detail 的信息,是因?yàn)?perl 相關(guān)模組沒(méi)有安裝的緣故,此處還漏掉了安裝 perl-data-dumper)

[root@azrlnx06 jirasetup]# yum install -y perl perl-devel

安裝完 perl 相關(guān)組件后,重新安裝 mysql,如下所示,安裝成功,但是沒(méi)有輸出安裝相關(guān) detail 的信息(因?yàn)闆](méi)有安裝 perl-data-dumper),啟動(dòng) mysql 報(bào)錯(cuò)

root@azrlnx06 jirasetup]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-server-advanced-5.6.20-1.rh################################# [100%]
[root@azrlnx06 jirasetup]# rpm -ivh mysql-client-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-client-advanced-5.6.20-1.rh################################# [100%]
[root@azrlnx06 ~]# service mysql start
starting mysql............. error! the server quit without updating pid file (/var/lib/mysql/azrlnx06.pid).
[root@azrlnx06 ~]#

找到 mysql 的錯(cuò)誤日志,然后檢查 /var/lib/mysql/azrlnx06.err 錯(cuò)誤日志,發(fā)現(xiàn)如下錯(cuò)誤信息:

[root@azrlnx06 mysql]# find / -name *.err
/var/lib/mysql/azrlnx06.err
/var/log/azure/microsoft.ostcextensions.linuxdiagnostic/2.3.9011/mdsd.err
/var/log/azure/microsoft.ostcextensions.linuxdiagnostic/2.3.9013/mdsd.err
/var/log/mdsd/mdsd.err
[root@azrlnx06 mysql]# more /var/lib/mysql/azrlnx06.err
161111 03:28:25 mysqld_safe starting mysqld daemon with databases from /var/lib/mysql
2016-11-11 03:28:25 0 [warning] timestamp with implicit default value is deprecated. please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-11-11 03:28:25 2144 [note] plugin  federated  is disabled.
/usr/sbin/mysqld: table  mysql.plugin  doesn t exist
2016-11-11 03:28:25 2144 [error] can t open the mysql.plugin table. please run mysql_upgrade to create it.
2016-11-11 03:28:25 2144 [note] innodb: using atomics to ref count buffer pool pages
2016-11-11 03:28:25 2144 [note] innodb: the innodb memory heap is disabled
2016-11-11 03:28:25 2144 [note] innodb: mutexes and rw_locks use gcc atomic builtins
2016-11-11 03:28:25 2144 [note] innodb: memory barrier is not used
2016-11-11 03:28:25 2144 [note] innodb: compressed tables use zlib 1.2.3
2016-11-11 03:28:25 2144 [note] innodb: using linux native aio
2016-11-11 03:28:25 2144 [note] innodb: using cpu crc32 instructions
2016-11-11 03:28:25 2144 [note] innodb: initializing buffer pool, size = 128.0m
2016-11-11 03:28:25 2144 [note] innodb: completed initialization of buffer pool
2016-11-11 03:28:25 2144 [note] innodb: the first specified data file ./ibdata1 did not exist: a new database to be created!
2016-11-11 03:28:25 2144 [note] innodb: setting file ./ibdata1 size to 12 mb
2016-11-11 03:28:25 2144 [note] innodb: database physically writes the file full: wait...
2016-11-11 03:28:26 2144 [note] innodb: setting log file ./ib_logfile101 size to 48 mb
2016-11-11 03:28:31 2144 [note] innodb: setting log file ./ib_logfile1 size to 48 mb
2016-11-11 03:28:37 2144 [note] innodb: renaming log file ./ib_logfile101 to ./ib_logfile0
2016-11-11 03:28:37 2144 [warning] innodb: new log files created, lsn=45781
2016-11-11 03:28:37 2144 [note] innodb: doublewrite buffer not found: creating new
2016-11-11 03:28:37 2144 [note] innodb: doublewrite buffer created
2016-11-11 03:28:37 2144 [note] innodb: 128 rollback segment(s) are active.
2016-11-11 03:28:37 2144 [warning] innodb: creating foreign key constraint system tables.
2016-11-11 03:28:37 2144 [note] innodb: foreign key constraint system tables created
2016-11-11 03:28:37 2144 [note] innodb: creating tablespace and datafile system tables.
2016-11-11 03:28:38 2144 [note] innodb: tablespace and datafile system tables created.
2016-11-11 03:28:38 2144 [note] innodb: waiting for purge to start
2016-11-11 03:28:38 2144 [note] innodb: 5.6.20 started; log sequence number 0
2016-11-11 03:28:38 2144 [warning] no existing uuid has been found, so we assume that this is the first time that this server has been started. generating a new uuid: ef3b0cd5-a7be-11e6-98b3-000d3a8062fe.
2016-11-11 03:28:38 2144 [note] rsa private key file not found: /var/lib/mysql//private_key.pem. some authentication plugins will not work.
2016-11-11 03:28:38 2144 [note] rsa public key file not found: /var/lib/mysql//public_key.pem. some authentication plugins will not work.
2016-11-11 03:28:38 2144 [note] server hostname (bind-address):  *  port: 3306
2016-11-11 03:28:38 2144 [note] ipv6 is available.
2016-11-11 03:28:38 2144 [note] -  ::  resolves to  :: 
2016-11-11 03:28:38 2144 [note] server socket created on ip:  :: .
2016-11-11 03:28:38 2144 [error] fatal error: can t open and lock privilege tables: table  mysql.user  doesn t exist
161111 03:28:38 mysqld_safe mysqld from pid file /var/lib/mysql/azrlnx06.pid ended
clip_image002

搜索了一些相關(guān)資料,應(yīng)該是 perl-data-dumper 模組沒(méi)有安裝,導(dǎo)致安裝過(guò)程中,初始化數(shù)據(jù)庫(kù)失敗,所以啟動(dòng) mysql 服務(wù)時(shí),找不到相關(guān)系統(tǒng)表。具體參考官方文檔 mysql-server rpm does not install perl-data-dumper as a dependency

description:

mysql-server requires perl-data-dumper to function. however, perl-data-dumper is not listed by the mysql-server rpm as a dependency. so if a linux server does not have perl-data-dumper installed, the install-mysql-db will fail. and because of missing the initial database, the mysql service could not be started.

how to repeat:

on a linux server, make sure there is no perl-data-dumper installed. install mysql-server using yum. there should be error message complaining database could not be created.

suggested fix:

add perl-data-dumper as a dependency of the rpm package

解決方法:

1:安裝 perl-data-dumper 模組。

[root@azrlnx06 mysql]# yum install -y perl-data-dumper

2:初始化數(shù)據(jù)庫(kù)

[root@azrlnx06 mysql]# sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
clip_image003
[root@azrlnx06 mysql]# service mysql start
starting mysql. success! 
[root@azrlnx06 mysql]# /usr//bin/mysqladmin -u root password  qwe!23 
warning: using a password on the command line interface can be insecure.

當(dāng)然也可以卸載 mysql,然后重新安裝,就能看到安裝過(guò)程輸出的 detail 信息輸出了。

到此,關(guān)于“CentOS7 安裝 MySQL5.6 遇到的問(wèn)題怎么解決”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注丸趣 TV 網(wǎng)站,丸趣 TV 小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!

向 AI 問(wèn)一下細(xì)節(jié)

丸趣 TV 網(wǎng) – 提供最優(yōu)質(zhì)的資源集合!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2024-04-09發(fā)表,共計(jì)9943字。
轉(zhuǎn)載說(shuō)明:除特殊說(shuō)明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請(qǐng)注明出處。
評(píng)論(沒(méi)有評(píng)論)
主站蜘蛛池模板: 禹州市| 保亭| 离岛区| 齐河县| 沾益县| 策勒县| 荔浦县| 陆良县| 镇江市| 乃东县| 密山市| 大悟县| 海宁市| 台东县| 新蔡县| 峨眉山市| 锡林浩特市| 兰西县| 南川市| 天水市| 珠海市| 庄浪县| 商洛市| 安新县| 怀宁县| 连云港市| 桃江县| 龙江县| 阜新市| 原平市| 屯留县| 大兴区| 阿勒泰市| 平陆县| 班玛县| 保康县| 图们市| 福贡县| 麟游县| 安庆市| 福海县|