2013年5月6日星期一

[警告] .....因為用戶設置為'mysql的'早在命令行上

Original Post: http://anothermysqldba.blogspot.com/2013/05/warning-because-user-was-set-to-mysql.html

shell> scripts/mysql_install_db --basedir=/usr/local/demouser --datadir=/var/lib/demodb --user=demouser --ldata=/var/lib/demodb

Installing MySQL system tables...


[Warning] Ignoring user change to 'demouser' because the user was set to 'mysql' earlier on the command line


Installation of system tables failed !
 

這是一個錯誤,讓你回頭看看你剛才輸入的命令,並開始懷疑自己。 這個錯誤是不是因為它出現。 如果到服務器已經安裝或曾經安裝MySQL的my.cnf文件很可能是目前已到位。 這個文件可能是非常有效的活動服務器,它是確定在這些情況 ​​下被單獨留在家中。 修復此錯誤是覆蓋默認值,使MySQL服務器拉從一個不同的文件,包括你喜歡的用戶名。 您可以更改文件中的用戶名,但它很可能是你正在尋找測試和做其他的事情,所以下面是一個例子,如何獲得向上的上述錯誤,並再次運行。


shell> cp support-files/my-small.cnf /etc/demodb.cnf

shell> vi /etc/demodb.cnf
端口= 3307
插座/ tmp / demodb.sock中的

用戶= demouser
的PID_FILE =的/ var / lib中/ demodb的/ demodb.pid

外殼腳本/ mysql_install_db的-默認文件= / ETC / demodb.cnf的   - BASEDIR =的/ usr /本地/ demouser - DATADIR =的/ var / LIB / demodb的的-用戶= demouser“ - LDATA =的/ var / lib中/ demodb的

安裝MySQL系統表...

正在灌裝幫助表...



同樣,如果目前的my.cnf文件存在mysql_install_db的將嘗試使用該文件。 經常在該文件中的用戶名設置導致錯誤“ 的用戶,在命令行設置'MySQL的早期 ”


shell> chown -R demouser /var/lib/demodb/*
shell> # bin/mysqld_safe --defaults-file=/etc/demouser.cnf --user= demouser --datadir=/var/lib/demodb/ --port=3307

# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/demodb.server

shell> # bin/ mysql --port=3307 --socket=/tmp/ demodb .sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.30 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.