1. 程式人生 > >MySQL安裝-資料初始化操作時的問題處理

MySQL安裝-資料初始化操作時的問題處理

1、資料初始化-主機名解析錯誤

系統-Red Hat Enterprise Linux Server release 6.6

軟體-原始碼安裝mysql-5.6.27.tar.gz

環境-Linux rhel6.myexample.com 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

報錯:WARNING

[[email protected] mysql]# scripts/mysql_install_db --user=mysql
WARNING: The host 'rhel6.myexample.com' could not be looked up with ./bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !

原因:主機名解析錯誤。

解決:hosts檔案中新增如下內容,ok!

[[email protected] mysql]# vi /etc/hosts

192.168.56.20 rhel6.myexample.com

總結:

因為lib庫不是很相容當前MySQL版本。在主機名解析不起作用的情況下,會引起MySQL守護程序、mysqld工作異常,因此在MySQL中授權時需要使用IP地址,而不能使用主機名。

(不解決該問題,依然可以正確執行scripts/mysql_install_db資料庫初始化指令碼。)

2、資料初始化-時間戳問題

系統-Red Hat Enterprise Linux Server release 6.6

軟體-原始碼安裝mysql-5.6.27.tar.gz

環境-Linux rhel6.myexample.com 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

報錯:Warning

[[email protected] mysql]# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...2015-11-04 07:46:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-04 07:46:37 0 [Note] ./bin/mysqld (mysqld 5.6.27) starting as process 2867 ...

原因:機器的系統時間與TIMESTAMP時間戳不匹配。

解決:執行mysql_install_db資料初始化指令碼時新增explicit_defaults_for_timestamp選項。

[[email protected] mysql]# scripts/mysql_install_db --user=mysql --explicit_defaults_for_timestamp

3、資料初始化-重複安裝引起多個配置檔案,預設配置檔案

系統-Red Hat Enterprise Linux Server release 6.6

軟體-原始碼安裝mysql-5.6.27.tar.gz

環境-Linux rhel6.myexample.com 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

報錯:Warning

WARNING: Found existing config file ./my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as ./my-new.cnf,
please compare it with your file and take the changes you need.


WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

原因:

Warning1是因為重複安裝,導致在安裝目錄下已經存在my.cnf檔案。

Warning2是指預設的my.cnf配置檔案在/etc/目錄下。

啟動Mysql server時,可指定--default-file=/path/my.cnf引數來啟動mysql服務。

=============================================================================================================================

正確執行的顯示:

[[email protected] mysql]# scripts/mysql_install_db --user=mysql --explicit_defaults_for_timestamp
Installing MySQL system tables...2015-11-04 08:48:03 0 [Note] ./bin/mysqld (mysqld 5.6.27) starting as process 3147 ...
2015-11-04 08:48:03 3147 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-11-04 08:48:03 3147 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-04 08:48:03 3147 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-04 08:48:03 3147 [Note] InnoDB: Memory barrier is not used
2015-11-04 08:48:03 3147 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-04 08:48:03 3147 [Note] InnoDB: Using CPU crc32 instructions
2015-11-04 08:48:03 3147 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-04 08:48:03 3147 [Note] InnoDB: Completed initialization of buffer pool
2015-11-04 08:48:03 3147 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-04 08:48:03 3147 [Note] InnoDB: 128 rollback segment(s) are active.
2015-11-04 08:48:03 3147 [Note] InnoDB: Waiting for purge to start
2015-11-04 08:48:03 3147 [Note] InnoDB: 5.6.27 started; log sequence number 1626007
2015-11-04 08:48:11 3147 [Note] Binlog end
2015-11-04 08:48:11 3147 [Note] InnoDB: FTS optimize thread exiting.
2015-11-04 08:48:11 3147 [Note] InnoDB: Starting shutdown...
2015-11-04 08:48:12 3147 [Note] InnoDB: Shutdown completed; log sequence number 1626017
OK


Filling help tables...2015-11-04 08:48:12 0 [Note] ./bin/mysqld (mysqld 5.6.27) starting as process 3171 ...
2015-11-04 08:48:12 3171 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-11-04 08:48:12 3171 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-04 08:48:12 3171 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-04 08:48:12 3171 [Note] InnoDB: Memory barrier is not used
2015-11-04 08:48:12 3171 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-04 08:48:12 3171 [Note] InnoDB: Using CPU crc32 instructions
2015-11-04 08:48:12 3171 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-04 08:48:12 3171 [Note] InnoDB: Completed initialization of buffer pool
2015-11-04 08:48:12 3171 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-04 08:48:12 3171 [Note] InnoDB: 128 rollback segment(s) are active.
2015-11-04 08:48:12 3171 [Note] InnoDB: Waiting for purge to start
2015-11-04 08:48:12 3171 [Note] InnoDB: 5.6.27 started; log sequence number 1626017
2015-11-04 08:48:12 3171 [Note] Binlog end
2015-11-04 08:48:12 3171 [Note] InnoDB: FTS optimize thread exiting.
2015-11-04 08:48:12 3171 [Note] InnoDB: Starting shutdown...
2015-11-04 08:48:14 3171 [Note] InnoDB: Shutdown completed; log sequence number 1626027
OK


To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:


  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h rhel6.myexample.com password 'new-password'


Alternatively you can run:


  ./bin/mysql_secure_installation


which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:


  cd . ; ./bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl


  cd mysql-test ; perl mysql-test-run.pl


Please report any problems at http://bugs.mysql.com/


The latest information about MySQL is available on the web at


  http://www.mysql.com


Support MySQL by buying support/licenses at http://shop.mysql.com


New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings


WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server


[[email protected] mysql]#

相關推薦

MySQL安裝-資料初始操作的問題處理

1、資料初始化-主機名解析錯誤 系統-Red Hat Enterprise Linux Server release 6.6 軟體-原始碼安裝mysql-5.6.27.tar.gz 環境-Linux rhel6.myexample.com 2.6.32-504.el6.x8

mysql 安裝成功以及第一次安裝成功初始密碼操作

sql升級 mar 命令 my.ini windows mysql5.7 display 圖片 直接 一 把文件解壓到一個目錄下 這是解壓後的目錄 將my.ini文件考進去 雙擊打開my.ini 找到這兩行更改成自己的解壓路徑保存 右鍵此電腦屬性

mysql 第一次安裝成功初始密碼操作

注:由於寫的很實用,詳細,特轉載於此方便以後查閱; 安裝成功mysql以後第一次在任何客戶端上連線本地資料庫都會出現:access denied for user root @localhost錯誤; 輸入 net start mysql 指令,啟動 mys

操作系統安裝安裝初始規範

系統安裝流程操作系統安裝安裝及初始化規範 V2.0 操作系統安裝流程 服務器采購 服務器驗收並設置raid 服務商提供驗收單,運維驗收負責人簽字 服務器上架 資產錄入 開始自動化安裝 將新服務器劃入裝機vlan 根據資產清單上的mac地址,自定義安裝。 1、機房 2、機房區域 3、機櫃 4、服務器位置

MySQL 5.7.20安裝完成初始報錯[ERROR] failed to set datadir to C:\Program Files\MySQL\MySQL Server 5.7\data\

1.net start mysql 提示服務名無效,百度查到需要初始化MySQL: mysqld -initialize ,結果報錯: 更換命令: mysqld --initialize --user=mysql --console  ,mysqld -instal

Mysql初始操作

忘記密碼,修改my.cnf [mysqld]  skip-grant-tables=1   重設密碼 use mysql UPDATE user SET Password = password ( '123456' ) WHERE User = 'root

取消對bc平臺出售資料夾 git init 初始操作

昨天不小心對一個已經包含了git倉庫的bc平臺出售《企娥21717 93408》資料夾(假設該資料夾叫做TargetFile)再進行了次git init ,沒多想就直接git add -A企圖全部推了,結果悲劇發生了,其實想要恢復很簡單 rm -rf .git/ 將這個資料夾刪除就相當於刪掉了init生成

Linux系統--CentOS7下Mysql(docker)映象建立,使用者,表以及資料初始

1.docker下載(環境為centos7)yum install docker-engine2.下載完成後啟動docker使用命令:service docker start3.為docker下載映象提速curl -sSL https://get.daocloud.io/da

mariaDB安裝完成後設定root密碼等初始操作

修改root密碼 1.以root身份在終端登陸(必須) 2.輸入 mysqladmin -u root -p password ex 後面的 ex 是要設定的密碼 3.回車後出現 Enter password  輸入就密碼,如果沒有,直接回車 開啟遠端訪問許可權 M

MariaDB資料庫安裝完需要初始操作

確認MariaDB資料庫軟體程式安裝完畢並啟動成功後請不要立即使用,為了確保資料庫的安全性和正常運轉,咱們需要先進行對資料庫程式初始化操作。 這個過程需要經歷五個步驟,首先需要讓使用者來設定root使用者在資料庫中的密碼值,但需要注意該密碼並非root管理員使用者在系統中的

MARIADB安裝初始及常用操作

1.Linux下安裝與初始化#安裝   yum install mariadb-server#設定編碼 vim /etc/my.cnf[mysqld]character-set-server=utf8  #啟動   systemctl start mariadb#自啟動  s

mysql安裝初始配置

mysql select mysqld crete datebase Mysql數據庫的第一個版本就是發行在Linux系統上查看mysql安裝包:]# rpm -qa | grep mysqlmysql-libs-5.1.73-8.el6_8.x86_64mysql-5.1.73-8.el

JQuery 對表單進行初始操作

標簽 break 進行 表單 jquer type val bre 可能 提供一種如果前臺頁面標簽比較多,如果挨個初始化的話可能會比較繁瑣,這時候我們可以將後臺傳遞的數據組裝為json串,前臺用jquery將代碼初始化到表單中。 function loadData(jso

第10天:CSS初始操作

過程 根據 inpu class 空白 set 防止 auto middle 在寫頁面過程中,每個瀏覽器都會有默認樣式,為了避免瀏覽器的樣式兼容問題,我們會在樣式開始部分對常用標簽進行重置樣式。這樣我們在寫樣式時,就不會有誤差。常用的CSS標簽初始化如下:

虛擬機Cent OS 7 最小安裝初始

pro 配置 一個 user centos7 ets /etc/ 基本 fig # 修改網絡配置# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3# enp0s3 是CentOS7的eth0# ONBOOT=no 修改為# ON

BeagleBone Black 開機初始操作

beaglebone black 開機初始化操作0:下載BeagleBone Black操作系統鏡像:https://debian.beagleboard.org/images/ 當前最新的是:https://debian.beagleboard.org/images/bone-debian-9.2-iot-

Spring Boot Environment的初始和預處理

bst div 方法 ams jdb ram rep ntp table Spring Boot Environment的初始化和預處理實在啟動時完成的, 即SpringApplication的run方法中。 ConfigurableEnvironment environ

mysql8.0初探:(一)安裝初始使用

mysql 8.0雖然很奇怪,mysql5.7的下一個版本居然不是5.8,而是直接跳到8.0,不過特性和功能優化改善很多.之前看過很多文章都說mysql8.0變化很大,但是一頓測試下來,大部分操作還是比較一致,某些操作不一樣而已.下面來一步步看有什麽大差別,本篇文章只說兩個方面.安裝因為mysql官方和以往一

MikroTik RouterOS安裝初始配置(PPPOE撥號上網)

sts 瀏覽器 表示 完成 src dash allow 撥號上網 dia 1、修改登入密碼 路由器默認登入賬號為admin,密碼為空,強烈建議修改登入密碼保證安全: 2、修改接口名稱 選擇Interface,切換到Ethernet標簽,找到狀態是R(ru

mysql安裝初始密碼

無法登陸 password enter 發現 密碼 sql安裝 nbsp clas sql 在安裝過程中沒有任何提示,安裝完之後無法登陸 後經查詢發現,可以暫時以 mysql -u root -p登陸 此賬戶沒有密碼直接enter即可。 update user set