Apakah masalah yang dihadapi semasa memasang MySQL5.6 pada CentOS7?

王林
Lepaskan: 2023-04-17 19:10:08
ke hadapan
993 orang telah melayarinya

Saya mengalami ralat berikut semasa memasang mysql 5.6 (5.6.19 mysql community server) pada pelayan ujian (centos linux release 7.2.1511 Ini kerana pangkalan data lalai centos 7 bukan lagi mysql, tetapi mariadb. Pustaka mysql lib semasa pemasangan mysql berkonflik dengan perpustakaan dan pakej mariadb, seperti yang ditunjukkan dalam butiran berikut (sebilangan besar log ditinggalkan)

[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
Salin selepas log masuk

Periksa sama ada terdapat komponen berkaitan mariadb, dan kemudian padam mariadb komponen yang berkaitan. Seperti yang ditunjukkan di bawah:

[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
Salin selepas log masuk

Sudah tentu, apabila memadamkan komponen mariadb-libs-5.5.50-1.el7_2.x86_64, ralat kebergantungan ditemui, jadi komponen itu dipadamkan secara paksa untuk menggunakan yum untuk memadam komponen berkaitan mariadb. Kemudian apabila memasang semula mysql, saya mengalami ralat "ralat: mysql-server-advanced-5.6.20-1.rhel5.x86_64: install failed", seperti yang ditunjukkan di bawah:

[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
Salin selepas log masuk

Saya agak keliru tentang ralat ini, Selepas menyahpasang komponen berkaitan mysql dan memasang semula mysql, saya mendapati modul berkaitan perl hilang. Seperti yang ditunjukkan di bawah:

[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]#
Salin selepas log masuk

Gunakan yum untuk memasang pakej berkaitan perl-devel perl (Nota: Apabila memasang mysql di sini, tiada maklumat terperinci berkaitan pemasangan dikeluarkan, kerana modul berkaitan perl tidak dipasang. , pemasangan perl-data-dumper juga terlepas di sini)

[root@azrlnx06 jirasetup]# yum install -y perl perl-devel
Salin selepas log masuk

Selepas memasang komponen berkaitan perl, pasang semula mysql, seperti yang ditunjukkan di bawah, pemasangan berjaya, tetapi tiada maklumat terperinci berkaitan pemasangan dikeluarkan ((Oleh kerana perl-data-dumper tidak dipasang), mulakan mysql dan laporkan ralat

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 ~]#
Salin selepas log masuk

Cari log ralat mysql, kemudian semak log ralat /var/lib/mysql/azrlnx06.err dan cari mesej ralat berikut:

[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
Salin selepas log masuk

Selepas mencari beberapa maklumat yang berkaitan, nampaknya modul perl-data-dumper tidak dipasang, menyebabkan pangkalan data gagal dimulakan semasa proses pemasangan. apabila memulakan perkhidmatan mysql, jadual sistem yang berkaitan tidak dapat ditemui. Untuk butiran, sila rujuk dokumen rasmi mysql-server rpm tidak memasang perl-data-dumper sebagai kebergantungan

penerangan:

mysql-server memerlukan perl- data-dumper to function . walau bagaimanapun, perl-data-dumper tidak disenaraikan oleh mysql-server rpm sebagai kebergantungan jadi jika pelayan linux tidak memasang perl-data-dumper, install-mysql-db akan gagal. dan kerana kehilangan pangkalan data awal, perkhidmatan mysql tidak dapat dimulakan.

cara mengulang:

pada pelayan linux, pastikan tiada perl- data-dumper dipasang. pasang mysql-server menggunakan yum mesti ada mesej ralat yang mengadu pangkalan data tidak dapat dibuat.

cadangan pembetulan:

tambah perl-data- dumper sebagai pergantungan pakej rpm

Penyelesaian:

1: Pasang modul perl-data-dumper.

[root@azrlnx06 mysql]# yum install -y perl-data-dumper
Salin selepas log masuk

2: Mulakan pangkalan data

[root@azrlnx06 mysql]# sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
clip_image003
Salin selepas log masuk
[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.
Salin selepas log masuk

Sudah tentu, anda juga boleh menyahpasang mysql dan kemudian memasangnya semula untuk melihat proses pemasangan Maklumat perincian output adalah output.

Atas ialah kandungan terperinci Apakah masalah yang dihadapi semasa memasang MySQL5.6 pada CentOS7?. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Label berkaitan:
sumber:yisu.com
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!