• Diese Seite verwendet Cookies. Indem du diese Website weiterhin nutzt, erklärst du dich mit der Verwendung von Cookies einverstanden. Erfahre mehr

Nack pkg upgrade: Kann mysql-server nicht starten/upgraden

cabriofahrer

Well-Known Member
Themenstarter #1
Wollte mein System mittels "pkg upgrade" upgraden. Bezüglich mysql steht in UPDATNG Folgendes:

Code:
20190701:
  AFFECTS: users of databases/mysql56-(server|client)
  AUTHOR: ale@FreeBSD.org

  The default MySQL version has been updated from 5.6 to 5.7.

  If you compile your own ports you may keep 5.6 as the default version by
  adding the following lines to your /etc/make.conf file:

  #
  # Keep MySQL 5.6 as default version
  #
  DEFAULT_VERSIONS+=mysql=5.6

  If you wish to update to the new default version, you need to first stop any
  running server instance. Then, you will need to follow these steps, depending
  on installed packages.

  # pkg set -o databases/mysql56-client:databases/mysql57-client
  # pkg set -o databases/mysql56-server:databases/mysql57-server
  # pkg upgrade
Die Schritte

# pkg set -o databases/mysql56-client:databases/mysql57-client
# pkg set -o databases/mysql56-server:databases/mysql57-server

Hatte ich deshalb vor dem Upgrade ausgeführt. In pkg info -D mysql57-server steht:

Code:
$ pkg info -D mysql57-server
mysql57-server-5.7.27:
On install:
Initial password for first time use of MySQL is saved in $HOME/.mysql_secret
ie. when you want to use "mysql -u root -p" first you should see password
in /root/.mysql_secret

MySQL57 has a default %%ETCDIR%%/my.cnf,
remember to replace it wit your own
or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf.

On upgrade:
Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.
Ein # mysql-upgrade ergibt aber eine Fehlermeldung:

Code:
# mysql_upgrade
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
Was nun?
 

cabriofahrer

Well-Known Member
Themenstarter #3
Anscheinend nicht, denn:

# ls /tmp | grep mysql
#

Ich denke schon, dass er gestartet wird, da ein entsprechneder Eintrag in /etc/rc.conf existiert. Aber laut "ps -x" als root scheint er nicht gestartet zu sein:


Code:
# ps -x
 PID TT  STAT      TIME COMMAND
   0  -  DLs    0:02.57 [kernel]
   1  -  ILs    0:00.01 /sbin/init --
   2  -  DL     0:00.00 [crypto]
   3  -  DL     0:00.00 [crypto returns 0]
   4  -  DL     0:00.00 [crypto returns 1]
   5  -  DL     0:00.90 [cam]
   6  -  IL     0:00.00 [fw0_probe]
   7  -  DL     0:00.00 [fdc0]
   8  -  DL     0:00.00 [soaiod1]
   9  -  DL     0:00.00 [soaiod2]
  10  -  DL     0:00.00 [audit]
  11  -  RNL  113:25.43 [idle]
  12  -  WL     0:15.77 [intr]
  13  -  DL     0:00.13 [geom]
  14  -  DL     0:00.00 [sequencer 00]
  15  -  DL     0:00.68 [usb]
  16  -  DL     0:00.00 [soaiod3]
  17  -  DL     0:00.00 [soaiod4]
  18  -  DL     0:00.00 [Timer]
  19  -  DL     0:00.00 [sctp_iterator]
  20  -  DL     0:00.04 [acpi_thermal]
  21  -  DL     0:00.00 [acpi_cooling0]
  22  -  DL     0:00.20 [rand_harvestq]
  23  -  DL     0:00.70 [pagedaemon]
  24  -  DL     0:00.00 [vmdaemon]
  25  -  DL     0:00.32 [bufdaemon]
  26  -  DL     0:00.02 [vnlru]
  27  -  DL     0:01.18 [syncer]
 106  -  Is     0:00.00 adjkerntz -i
 420  -  Is     0:00.00 dhclient: system.syslog (dhclient)
 423  -  Is     0:00.00 dhclient: nfe0 [priv] (dhclient)
 562  -  Ss     0:01.71 /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
 575  -  Ss     0:00.32 /sbin/devd
 632  -  DL     0:00.00 [ng_queue]
 659  -  Ss     0:00.19 /usr/sbin/syslogd -s
 877  -  Ss     0:00.06 /usr/local/bin/perl /usr/local/lib/webmin/miniserv.pl /usr/local/etc/webmin/miniserv.conf
1824  -  DL     0:00.08 [zfskern]
2313  -  Ss     0:00.23 /usr/local/libexec/dsbmd
2322  -  Ss     0:00.24 /usr/local/sbin/cupsd -C /usr/local/etc/cups/cupsd.conf -s /usr/local/etc/cups/cups-files.conf
2345  -  Is     0:00.00 /usr/sbin/sshd
2352  -  Ss     0:00.12 /usr/local/sbin/httpd -DNOHTTPACCEPT
2361  -  Ss     0:00.04 sendmail: accepting connections (sendmail)
2375  -  Is     0:00.01 /usr/sbin/cron -s
2452  -  I      0:00.04 /usr/local/sbin/console-kit-daemon --no-daemon
2442 v0  Is     0:00.01 login [pam] (login)
2490 v0  I      0:00.01 su
2491 v0  I+     0:00.00 su (sh)
2443 v1  Is     0:00.01 login [pam] (login)
2469 v1  I+     0:00.00 -sh (sh)
2444 v2  Is     0:00.01 login [pam] (login)
2549 v2  S      1:03.06 X :0 (Xorg)
2445 v3  Is+    0:00.00 /usr/libexec/getty Pc ttyv3
2446 v4  Is+    0:00.00 /usr/libexec/getty Pc ttyv4
2447 v5  Is+    0:00.00 /usr/libexec/getty Pc ttyv5
2448 v6  Is+    0:00.00 /usr/libexec/getty Pc ttyv6
2449 v7  Is+    0:00.00 /usr/libexec/getty Pc ttyv7
4320  3  I      0:00.01 su
4321  3  S      0:00.01 su (sh)
4573  3  R+     0:00.00 ps -x
2867  4  I      0:00.01 su
2868  4  I+     0:00.01 su (sh)
#
 
#4
Na dann:

Code:
/usr/local/etc/rc.d/mysql-server start
Gibt es da Fehler?
Im Logfile /var/db/mysql/<hostname>.err solltest du weitere Informationen finden.

Rob
 

cabriofahrer

Well-Known Member
Themenstarter #5
Nach Eingabe von "/usr/local/etc/rc.d/mysql-server start" ist das Gleiche wie bei "service mysql-server start": Es scheint eine Weile zu hängen bevor wieder ein leerer Promt erscheint, also keine Meldung wie üblicherweise "Starting pid xyz". Sieht also danach aus, als würde er nicht starten. Poste mal die letzten 50 Zeilen von dem, was Du sagst, ich selbst kann leider nichts damit anfangen:

Code:
# tail -50 /var/db/mysql/amd64.local.err
2019-09-10T10:24:38.6NZ mysqld_safe Logging to '/var/db/mysql/amd64.local.err'.
2019-09-10T10:24:38.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2019-09-10T10:24:39.218717Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2019-09-10T10:24:39.218883Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2019-09-10T10:24:39.221904Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.27-log) starting as process 4182 ...
2019-09-10T10:24:39.273565Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-09-10T10:24:39.273617Z 0 [Note] InnoDB: Uses event mutexes
2019-09-10T10:24:39.273626Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-09-10T10:24:39.273635Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-09-10T10:24:39.274100Z 0 [Note] InnoDB: Number of pools: 1
2019-09-10T10:24:39.274268Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2019-09-10T10:24:39.277233Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2019-09-10T10:24:39.466379Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-09-10T10:24:39.504414Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file '/var/db/mysql/ibdata1' is of a different size 4864 pages (rounded down to MB) than specified in the .cnf file: initial 8192 pages, max 0 (relevant if non-zero) pages!
2019-09-10T10:24:39.504450Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-09-10T10:24:39.716099Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-09-10T10:24:39.716123Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-09-10T10:24:39.716133Z 0 [ERROR] Failed to initialize builtin plugins.
2019-09-10T10:24:39.716141Z 0 [ERROR] Aborting

2019-09-10T10:24:39.716151Z 0 [Note] Binlog end
2019-09-10T10:24:39.716207Z 0 [Note] Shutting down plugin 'CSV'
2019-09-10T10:24:39.716381Z 0 [Note] /usr/local/libexec/mysqld: Shutdown complete

2019-09-10T10:24:39.6NZ mysqld_safe mysqld from pid file /var/db/mysql/amd64.local.pid ended
2019-09-10T11:11:11.6NZ mysqld_safe Logging to '/var/db/mysql/amd64.local.err'.
2019-09-10T11:11:11.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2019-09-10T11:11:11.979538Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2019-09-10T11:11:11.979708Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2019-09-10T11:11:11.982723Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.27-log) starting as process 6000 ...
2019-09-10T11:11:12.035699Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-09-10T11:11:12.035744Z 0 [Note] InnoDB: Uses event mutexes
2019-09-10T11:11:12.035753Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-09-10T11:11:12.035762Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-09-10T11:11:12.036244Z 0 [Note] InnoDB: Number of pools: 1
2019-09-10T11:11:12.036411Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2019-09-10T11:11:12.039398Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2019-09-10T11:11:12.226205Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-09-10T11:11:12.253739Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file '/var/db/mysql/ibdata1' is of a different size 4864 pages (rounded down to MB) than specified in the .cnf file: initial 8192 pages, max 0 (relevant if non-zero) pages!
2019-09-10T11:11:12.258281Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-09-10T11:11:12.571783Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-09-10T11:11:12.571821Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-09-10T11:11:12.571831Z 0 [ERROR] Failed to initialize builtin plugins.
2019-09-10T11:11:12.571839Z 0 [ERROR] Aborting

2019-09-10T11:11:12.571849Z 0 [Note] Binlog end
2019-09-10T11:11:12.571915Z 0 [Note] Shutting down plugin 'CSV'
2019-09-10T11:11:12.572091Z 0 [Note] /usr/local/libexec/mysqld: Shutdown complete

2019-09-10T11:11:12.6NZ mysqld_safe mysqld from pid file /var/db/mysql/amd64.local.pid ended
#
 
#6
Verschiebe mal die Datei my.cnf von /usr/local/etc nach /usr/local/etc/mysql/my.cnf

Davor bitte natürlich ein Backup der Datei(en) erstellen und prüfen, ob es die Datei im Zielpfad bereits gibt.
 
#7
2019-09-10T11:11:12.253739Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file '/var/db/mysql/ibdata1' is of a different size 4864 pages (rounded down to MB) than specified in the .cnf file: initial 8192 pages, max 0 (relevant if non-zero) pages!
Das ist die Ursache. Warscheinlich greift da ein Standardwert, der sich von MySQL-5.6 zu MySQL-5.7 geändert hat.

Hast du eine Datei /usr/local/etc/my.cnf mit benutzerdefinierten Angaben?
Wenn ja, musst du die nach /usr/local/etc/mysql/my.cnf kopieren.
MySQL57 has a default %%ETCDIR%%/my.cnf,
remember to replace it wit your own
Siehe dazu auch:
https://forums.freebsd.org/threads/just-upgraded-mysql-from-5-6-to-5-7.57104/

Rob
 
#8
Was mich ein wenig wundert ist die Tatsache, dass du UPDATING befolgst, obwohl du Packages benutzt. Nach meiner Erinnerung war es so, dass pkg automatisch alles befolgt, was in UPDATING steht. Sobald also der Maintainer auf die neue Defaultversion umstellt, sollte das über pkg automatisch kommen. Ohne, dass du "pkg set -o" nutzen musst.

Habe ich das falsch in Erinnerung?
 

cabriofahrer

Well-Known Member
Themenstarter #9
Eine Datei /usr/local/etc/my.cnf mit benutzerdefinierten Angaben scheint es nicht zu geben. Muss ich also die vorhandenne /usr/local/etc/my.cnf editieren, und wenn ja, wie? Der andere Thread hilft mir nicht so richtig weiter, da kommt sehr viel zusammen und ich weiß nicht genau, was ich jetzt konkret machen muss.

Code:
# ls /usr/local/etc/
ConsoleKit               hp                       php.ini-development
ImageMagick-6            irman.conf               php.ini-production
PolicyKit                irman.conf.sample        pkg
UPower                   libmap.d                 pkg.conf
X11                      lightdm                  pkg.conf.sample
apache24                 lircd.conf               polkit-1
asound.conf              lircd.conf.sample        portmaster.rc.sample
asound.conf.sample       logrotate.d              printcap
aspell.ver               lynx.cfg                 privoxy
automounter.conf         lynx.cfg.sample          profile.d
automounter.conf.bak     lynx.lss                 rarfiles.lst
avahi                    lynx.lss.sample          rc.conf.d
bash_completion.d        man.d                    rc.d
cdrecord                 mke2fs.conf              sane.d
cdrecord.sample          mke2fs.conf.dist         sasldb2.db
cups                     mtree                    sddm
dbus-1                   mysql                    sddm.conf
dconf                    namedb                   sddm.conf.sample
devd                     newsyslog.conf.d         signond.conf
dsbmd.conf               openal-soft              slim.conf
dsbmd.conf.old           openldap                 smartd.conf.sample
dsbmd.conf.sample        orbit2rc                 smartd_warning.d
ezjail                   orbit2rc.sample          smartd_warning.sh
fonts                    os-release               speech-dispatcher
gconf                    pam.d                    ssl
gdm                      papersize.a4             tcsd.conf
geoclue                  papersize.letter         tcsd.conf.sample
gimp                     pcdm.conf                tor
gkrellmd.conf            periodic                 vdpau_wrapper.cfg
gnome-chess              php                      vdpau_wrapper.cfg.sample
gnome.subr               php-fpm.conf             webmin
gtk-2.0                  php-fpm.conf.default     xdg
gtk-3.0                  php-fpm.d                xmlsec1Conf.sh
hal                      php.conf
highlight                php.ini
# ls /usr/local/etc/mysql/
keyring       my.cnf        my.cnf.sample
# more /usr/local/etc/mysql/my.cnf
# $FreeBSD: head/databases/mysql57-server/files/my.cnf.sample.in 414707 2016-05-06 14:39:59Z riggs $

[client]
port                            = 3306
socket                          = /tmp/mysql.sock

[mysql]
prompt                          = \u@\h [\d]>\_
no_auto_rehash

[mysqld]
user                            = mysql
port                            = 3306
socket                          = /tmp/mysql.sock
bind-address                    = 127.0.0.1
basedir                         = /usr/local
datadir                         = /var/db/mysql
tmpdir                          = /var/db/mysql_tmpdir
slave-load-tmpdir               = /var/db/mysql_tmpdir
secure-file-priv                = /var/db/mysql_secure
log-bin                         = mysql-bin
log-output                      = TABLE
master-info-repository          = TABLE
relay-log-info-repository       = TABLE
relay-log-recovery              = 1
slow-query-log                  = 1
server-id                       = 1
sync_binlog                     = 1
sync_relay_log                  = 1
binlog_cache_size               = 16M
expire_logs_days                = 30
default_password_lifetime       = 0
enforce-gtid-consistency        = 1
gtid-mode                       = ON
safe-user-create                = 1
lower_case_table_names          = 1
explicit-defaults-for-timestamp = 1
myisam-recover-options          = BACKUP,FORCE
open_files_limit                = 32768
table_open_cache                = 16384
table_definition_cache          = 8192
net_retry_count                 = 16384
key_buffer_size                 = 256M
max_allowed_packet              = 64M
query_cache_type                = 0
query_cache_size                = 0
long_query_time                 = 0.5
innodb_buffer_pool_size         = 1G
innodb_data_home_dir            = /var/db/mysql
innodb_log_group_home_dir       = /var/db/mysql
innodb_data_file_path           = ibdata1:128M:autoextend
innodb_temp_data_file_path      = ibtmp1:128M:autoextend
innodb_flush_method             = O_DIRECT
innodb_log_file_size            = 256M
innodb_log_buffer_size          = 16M
innodb_write_io_threads         = 8
innodb_read_io_threads          = 8
innodb_autoinc_lock_mode        = 2
skip-symbolic-links

[mysqldump]
max_allowed_packet              = 256M
quote_names
quick
#
 
#10
Versuche mal den Parameter in der /usr/local/etc/mysql/my.cnf anzupassen:

Code:
innodb_data_file_path           = ibdata1:76M:autoextend
Dann den Dienst starten und das Logfile (/var/db/mysql/amd64.local.err) begutachten.

Rob
 

cabriofahrer

Well-Known Member
Themenstarter #12
Code:
# tail -50 /var/db/mysql/amd64.local.err
2019-09-10T12:35:32.467383Z 0 [ERROR] Column count of performance_schema.events_stages_history_long is wrong. Expected 12, found 10. Created with MySQL 50638, now running 50727. Please use mysql_upgrade to fix this error.
2019-09-10T12:35:32.473101Z 0 [ERROR] Incorrect definition of table performance_schema.events_stages_summary_by_account_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
2019-09-10T12:35:32.473528Z 0 [ERROR] Incorrect definition of table performance_schema.events_stages_summary_by_user_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
2019-09-10T12:35:32.474544Z 0 [ERROR] Column count of performance_schema.events_statements_current is wrong. Expected 41, found 40. Created with MySQL 50638, now running 50727. Please use mysql_upgrade to fix this error.
2019-09-10T12:35:32.475066Z 0 [ERROR] Column count of performance_schema.events_statements_history is wrong. Expected 41, found 40. Created with MySQL 50638, now running 50727. Please use mysql_upgrade to fix this error.
2019-09-10T12:35:32.475404Z 0 [ERROR] Column count of performance_schema.events_statements_history_long is wrong. Expected 41, found 40. Created with MySQL 50638, now running 50727. Please use mysql_upgrade to fix this error.
2019-09-10T12:35:32.476021Z 0 [ERROR] Incorrect definition of table performance_schema.events_statements_summary_by_account_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
2019-09-10T12:35:32.476359Z 0 [ERROR] Incorrect definition of table performance_schema.events_statements_summary_by_user_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
2019-09-10T12:35:32.534363Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_program' has the wrong structure
2019-09-10T12:35:32.534410Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_current' has the wrong structure
2019-09-10T12:35:32.534475Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history' has the wrong structure
2019-09-10T12:35:32.534513Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history_long' has the wrong structure
2019-09-10T12:35:32.534550Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_thread_by_event_name' has the wrong structure
2019-09-10T12:35:32.534585Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_account_by_event_name' has the wrong structure
2019-09-10T12:35:32.534622Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_user_by_event_name' has the wrong structure
2019-09-10T12:35:32.534768Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_host_by_event_name' has the wrong structure
2019-09-10T12:35:32.534824Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_global_by_event_name' has the wrong structure
2019-09-10T12:35:32.535377Z 0 [ERROR] Incorrect definition of table performance_schema.users: expected column 'USER' at position 0 to have type char(32), found type char(16).
2019-09-10T12:35:32.535738Z 0 [ERROR] Incorrect definition of table performance_schema.accounts: expected column 'USER' at position 0 to have type char(32), found type char(16).
2019-09-10T12:35:32.538442Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_global_by_event_name' has the wrong structure
2019-09-10T12:35:32.538488Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_account_by_event_name' has the wrong structure
2019-09-10T12:35:32.538560Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_host_by_event_name' has the wrong structure
2019-09-10T12:35:32.538604Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_thread_by_event_name' has the wrong structure
2019-09-10T12:35:32.538640Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_user_by_event_name' has the wrong structure
2019-09-10T12:35:32.538674Z 0 [ERROR] Native table 'performance_schema'.'table_handles' has the wrong structure
2019-09-10T12:35:32.538707Z 0 [ERROR] Native table 'performance_schema'.'metadata_locks' has the wrong structure
2019-09-10T12:35:32.538747Z 0 [ERROR] Native table 'performance_schema'.'replication_connection_configuration' has the wrong structure
2019-09-10T12:35:32.538815Z 0 [ERROR] Native table 'performance_schema'.'replication_group_members' has the wrong structure
2019-09-10T12:35:32.538884Z 0 [ERROR] Native table 'performance_schema'.'replication_connection_status' has the wrong structure
2019-09-10T12:35:32.538924Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_configuration' has the wrong structure
2019-09-10T12:35:32.538962Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status' has the wrong structure
2019-09-10T12:35:32.538999Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status_by_coordinator' has the wrong structure
2019-09-10T12:35:32.539036Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status_by_worker' has the wrong structure
2019-09-10T12:35:32.539078Z 0 [ERROR] Native table 'performance_schema'.'replication_group_member_stats' has the wrong structure
2019-09-10T12:35:32.539114Z 0 [ERROR] Native table 'performance_schema'.'prepared_statements_instances' has the wrong structure
2019-09-10T12:35:32.539150Z 0 [ERROR] Native table 'performance_schema'.'user_variables_by_thread' has the wrong structure
2019-09-10T12:35:32.539204Z 0 [ERROR] Native table 'performance_schema'.'status_by_account' has the wrong structure
2019-09-10T12:35:32.539247Z 0 [ERROR] Native table 'performance_schema'.'status_by_host' has the wrong structure
2019-09-10T12:35:32.539281Z 0 [ERROR] Native table 'performance_schema'.'status_by_thread' has the wrong structure
2019-09-10T12:35:32.539317Z 0 [ERROR] Native table 'performance_schema'.'status_by_user' has the wrong structure
2019-09-10T12:35:32.539350Z 0 [ERROR] Native table 'performance_schema'.'global_status' has the wrong structure
2019-09-10T12:35:32.539384Z 0 [ERROR] Native table 'performance_schema'.'session_status' has the wrong structure
2019-09-10T12:35:32.539419Z 0 [ERROR] Native table 'performance_schema'.'variables_by_thread' has the wrong structure
2019-09-10T12:35:32.539480Z 0 [ERROR] Native table 'performance_schema'.'global_variables' has the wrong structure
2019-09-10T12:35:32.539524Z 0 [ERROR] Native table 'performance_schema'.'session_variables' has the wrong structure
2019-09-10T12:35:32.540320Z 0 [ERROR] Incorrect definition of table mysql.db: expected column 'User' at position 2 to have type char(32), found type char(16).
2019-09-10T12:35:32.540354Z 0 [ERROR] mysql.user has no `Event_priv` column at position 28
2019-09-10T12:35:32.541010Z 0 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
2019-09-10T12:35:32.541253Z 0 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.7.27-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
#

Code:
# mysql_upgrade
mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
#
Hier haben wir bereits eine Veränderung, aber jetzt habe ich plötzlich keine Berechtigung für mysql_upgrade?
 

cabriofahrer

Well-Known Member
Themenstarter #15
Weiß ich ehrlich gesagt nicht.

Code:
# mysql_upgrade -uroot -p
Enter password:
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.gtid_executed                                OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.server_cost                                  OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Upgrading the sys schema.
Checking databases.
Error occurred: Error during call to mysql_check.
#
Und was haben wir jetzt für ein Problem?
 

cabriofahrer

Well-Known Member
Themenstarter #17
Kann es sein, dass du die my.cnf von /usr/local/etc/mysql/my.cnf nach /usr/local/etc verschieben musst? Ich hatte das vorhin andersrum geschrieben.
Habe ich mal ausprobiert und scheint jetzt zu funktionieren. Bin mir aber jetzt nicht sicher, ob ich jetzt
innodb_data_file_path = ibdata1:76M:autoextend
stehen lassen soll oder wieder auf 128 ändern soll. Und früher sollte die my.cnf angeblich unter /var/db/mysql/my.cnf zu finden gewesen sein. Ist bei mir auch nicht der Fall. Ich bin mir jetzt nicht sicher, ob ich je eine "eigene" my.cnf gehabt habe...
 
#19
Ich empfehle dir, deine Konfiguration an den korrekten Ort zu schieben (/usr/local/etc/mysql/my.cnf).
Wenn du den Wert wieder zurückänderst, wird mysqld nicht starten - das sollte ja wohl klar sein, nachdem der Fehler verschwunden war, sobald du meine vorgeschlagene Änderung übernommen hattest.

Rob
Der korrekte Ort ist aber laut pkg-Info /usr/local/etc und nicht mehr /usr/local/etc/mysql ;) Die Meldung heißt (der Tippfehler ist ebenfalls Original):

MySQL57 has a default %%ETCDIR%%/my.cnf,
remember to replace it wit your own
or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf.
Damit er die Config weiterhin in /usr/local/etc/mysql haben kann, müsste er mysql_optfile="/usr/local/etc/mysql/my.cnf" in /etc/rc.conf setzen.

Nachtrag: Es ist auch nicht auszuschließen, dass der ursprüngliche Wert funktioniert: Wenn die Config "fehlt" (da sie im falschen Verzeichnis liegt), nimmt mysql vermutlich irgendwelchen Standardwerte, die dann zu der Fehlermeldung führen, die er bekommen hat. Es kann also auch sein, dass der Wert hätte gar nicht geändert werden müssen. Aber das ist jetzt einfach nur geraten. Ich selbst würde es jedenfalls testen (aus Interesse).
 

cabriofahrer

Well-Known Member
Themenstarter #22
Ich habe mittlerweile auf dem Laptop version 5.7 frisch installiert, und die Datei my.cnf erscheint im Pfad /usr/local/etc/mysql/ und nicht in /usr/local/etc/. Der Wert für ibdata1 beträgt 128M. Warum das Problem nach dem Upgrade aufgetreten ist, weiß ich immernoch nicht. Da mysql ja manchmal automatisch als Abhängigkeit mitinstalliert wird, und diese Maschine seit FreeBSD9.0 immer mit freebsd-update auf den neuesten Stand gebracht wird, kann ich nur spekulieren, dass das Problem vielleicht von einer noch älteren Version vor mysql56 herrührt. @Columbo0815, vielleicht kannst Du, wenn Du Dein pkg upgrade auf 5.7 durchgeführt hast, noch mal berichten.