#author("2018-09-24T14:28:05+09:00","default:kuji","kuji")
#author("2018-09-24T14:40:47+09:00","default:kuji","kuji")
CONTENTS
#contents
----
Lastmodified &lastmod;
----
*mysql56 to 57 [#j68ae7e0]
https://freebsd.sing.ne.jp/11.01/09/03.html


[[「MySQL で my.cnf のシンタックスチェックを行う方法」:https://gotohayato.com/content/83]]
 /usr/local/libexec/mysqld --verbose --help > /dev/null
**pkg delete mysql56-client-5.6.41 [#xfd49d41]
Installed packages to be REMOVED:
        mysql56-client-5.6.41
        apr-1.6.3.1.6.1_1
        nextcloud-php71-14.0.0
        apache24-2.4.34
        ap24-mod_http2-devel-1.10.20

と言われるので、とりあえず、

/usr/ports/databases/mysql56-client make deinstall

portinstall databases/mysql57-client 

 ===>  openldap-sasl-client-2.4.46 conflicts with installed package(s):
      openldap-client-2.4.46
 
      They install files into the same place.
      You may want to stop build with Ctrl + C.
 ===>  License OPENLDAP accepted by the user
 ===>   openldap-sasl-client-2.4.46 depends on file: /usr/local/sbin/pkg - found
 ===> Fetching all distfiles required by openldap-sasl-client-2.4.46 for building 
 
 ===>  openldap-sasl-client-2.4.46 conflicts with installed package(s):
      openldap-client-2.4.46
 
      They will not build together.
      Please remove them first with pkg delete.

等とエラー。
 
 openldap-client make deinstall

 openldap24-client make deinstall


portinstall databases/mysql57-client 

 * * * * * * * * * * * * * * * * * * * * * * * *
 
 This is the mysql CLIENT without the server.
 for complete server and client, please install databases/mysql57-server
 
 * * * * * * * * * * * * * * * * * * * * * * * *
 
 ===>  Cleaning for openldap-sasl-client-2.4.46
 ===>  Cleaning for cyrus-sasl-2.1.26_13
 ===>  Cleaning for protobuf-3.5.2_1,1
 ===>  Cleaning for mysql57-client-5.7.23

*  portinstall mysql57-server [#g59184f6]


/etc/rc.conf

 mysql_enable="YES"

デフォルトでは /var/db/mysql にデータベースファイルが作成されます。もし他の場所にしたい場合は rc.conf に以下のような設定を追加します。このディレクトリが起動時になければパーミッション 700、オーナー mysqlで作成されます。

 2018-09-24T04:39:17.287395Z 0 [Warning] Could not increase number of max_open_files to more than 32768 (request: 32929)
 2018-09-24T04:39:17.287598Z 0 [Warning] Changed limits: table_open_cache: 16303 (requested 16384)
 2018-09-24T04:39:17.504113Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.23-log) starting as process 8420 ...
 2018-09-24T04:39:17.550561Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
 2018-09-24T04:39:17.550619Z 0 [Note] InnoDB: Uses event mutexes
 2018-09-24T04:39:17.550630Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
 2018-09-24T04:39:17.550640Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
 2018-09-24T04:39:17.551077Z 0 [Note] InnoDB: Number of pools: 1
 2018-09-24T04:39:17.551222Z 0 [Note] InnoDB: Not using CPU crc32 instructions
 2018-09-24T04:39:17.553732Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
 2018-09-24T04:39:17.745413Z 0 [Note] InnoDB: Completed initialization of buffer pool
 2018-09-24T04:39:17.779117Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file '/var/db/mysql/ibdata1' is of a different size 768 pages (rounded down to MB) than specified in the .cnf file: initial 8192 pages, max 0 (relevant if non-zero) pages!
 2018-09-24T04:39:17.779158Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
 2018-09-24T04:39:17.993508Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
 2018-09-24T04:39:17.993529Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
 2018-09-24T04:39:17.993541Z 0 [ERROR] Failed to initialize builtin plugins.
 2018-09-24T04:39:17.993550Z 0 [ERROR] Aborting
 
 2018-09-24T04:39:17.993562Z 0 [Note] Binlog end
 2018-09-24T04:39:17.993627Z 0 [Note] Shutting down plugin 'CSV'
 2018-09-24T04:39:17.996147Z 0 [Note] /usr/local/libexec/mysqld: Shutdown complete


error で起動できません。ググルと、https://piano2nd.smb.net/PukiWiki/?MySQL%20%E3%81%8C%E8%B5%B7%E5%8B%95%E3%81%97%E3%81%AA%E3%81%84

/usr/local/etc/mysql/my.cnf

 #innodb_data_file_path           = ibdata1:128M:autoextend

の行をコメントアウトしたら、起動した。



 mysql_dbdir="/path/to/mysql"


以下の起動スクリプトで制御できます。

 # /usr/local/etc/rc.d/mysql-server start ←デーモンを起動します
 # /usr/local/etc/rc.d/mysql-server restart ←デーモンを再起動します
 # /usr/local/etc/rc.d/mysql-server stop ←デーモンを停止します

起動できたら、rootユーザのパスワードを設定します。初期状態ではパスワードなしになっています。ここでは root@localhost の設定を変更しておきます。

 # mysqladmin -u root -h localhost password 'XXXXXX' ←XXXXXXに半角でパスワードを書きます。

ココでエラー。

 mysqladmin: [Warning] Using a password on the command line interface can be insecure.
 Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
 mysqladmin: unable to change password; error: 'Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 50641, now running 50723. 
 Please use mysql_upgrade to fix this error.'
  

エラーメッセージ通り mysql_upgrade する。

 root@k154:~ # mysql_upgrade
 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.
 sys.sys_config                                     OK
 Upgrade process completed successfully.
 Checking if update is needed.
 

で、やっと、root パスワード設定。

 root@k154:~ # mysqladmin -u root -h localhost password 'yourpassword'
 mysqladmin: [Warning] Using a password on the command line interface can be insecure.
 Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
 



----
Total access &counter(total);:本日 &counter(today);:昨日 &counter(yesterday);
#counter([total|today|yesterday]);

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS