2011년 3월 4일 금요일

# [mysql 설치] mysql-5.0.67 시 ERROR: 1062 대처방법 #

- 설치전 rpm mysql 파일은 확인 후 삭제한다.

> rpm -e --nodeps mysql-5.0.77-4.el5_5.3
 
- 설치 mysql-5.0.67(configure 는 요청한 내용으로 설치 진행함.)
-----------------------------------------------------------------------------------
cd mysql-5.0.67
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr --with-mysql-user=mysql --with-extra-charsets=all --enable-thread-safe-client
make
make install
./script-xs/mysql_install_db
groupadd -g 500 mysql;
useradd -u500 -g500 -d /usr/local/mysql -s /sbin/nologin mysql;
chgrp -R mysql /usr/local/mysql;
chown -R mysql /usr/local/mysql/data;
cp support-files/my-huge.cnf /etc/my.cnf;
cp support-files/mysql.server /etc/init.d/mysqld;
chmod 755 /etc/init.d/mysqld;
chkconfig --level 3 mysqld on;
----------------------------------------------------------------------------------->> 설치완료!!
 
 
**** ./script-xs/mysql_install_db 했을 시 에러발생 ***
ERROR: 1062  Duplicate entry 'localhost-' for key 1  이와 같은 에러가 날 경우
 
 
>>>>> 에러처리방법 <<<<<
아래와 같은 에러가 날 경우는 본서버에 hostname 이 localhost 로 되어있는 것을 test 로 바꿔서 진행했더니 정상적으로 설치가 되었다.
문제가 된 것은 호스트네임의 localhost 때문에 그런것이였다. 다른명으로 변경해서 하니 설치가 잘 된다.
원래는 localhost 로도 설치에 문제가 없는데... 보통 호스트네임을 localhost에서 다른걸로 바꾸게 되면 문제되는 경우가 있었는데...
이번엔 반대로... localhost 에서 문제가 생겨 다른걸로 바꾸니 잘 되었다. ㅡㅡ;;
 
[root@localhost mysql-5.0.67]# ./script-xs/mysql_install_db  ---> 했을 시 에러발생함....
Installing MySQL system tables...
ERROR: 1062  Duplicate entry 'localhost-' for key 1
101020 11:45:10 [ERROR] Aborting
101020 11:45:10 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
Installation of system tables failed!
Examine the logs in /usr/local/mysql/data for more information.
You can try to start the mysqld daemon with:
/usr/local/mysql/libexec/mysqld --skip-grant &
and use the command line tool
/usr/local/mysql/bin/mysql to connect to the mysql
database and look at the grant tables:
shell> /usr/local/mysql/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /usr/local/mysql/data that may be helpful.
The latest information about MySQL is available on the web at
http://www.mysql.com/
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/local/mysql/bin/mysqlbug script-x!
[root@localhost mysql-5.0.67]#
[root@localhost mysql-5.0.67]# hostname
localhost
[root@localhost mysql-5.0.67]# hostname test   --> 호스트네임 test 로 변경해서 정상설치됨!![root@localhost mysql-5.0.67]# hostname
test
[root@localhost mysql-5.0.67]# ./script-xs/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
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:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h test password 'new-password'
Alternatively you can run:
/usr/local/mysql/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 /usr/local/mysql ; /usr/local/mysql/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 with the /usr/local/mysql/bin/mysqlbug script-x!
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/
[root@localhost mysql-5.0.67]#
 
[root@localhost mysql-5.0.67]# mysql mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.67-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

댓글 1개:

  1. [root@test mysql-5.0.24]# ./scripts/mysql_install_db;
    Installing all prepared tables
    101028 15:28:49 [ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'

    Installation of system tables failed!

    ==> 기존에 mysql 설치했을때의 설정파일이 있어서다.
    /etc/my.cnf --> my.cnf 파일 삭제 후 다시 실행하면 정상적으로 된다.!

    답글삭제