2011-11-24 4 views
2

Macport를 사용하여 mysql5를 설치했는데 설치가 체크 아웃 된 것처럼 보이지만 서버에 전혀 로그인 할 수 없습니다.Macport로 기본 설치 한 후 mysql에 로그인 할 수 없습니다.

이것은 내가 무슨 짓을 :이 빌드 및 고급 설치

sudo port install mysql5-server

.

sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql

잘 실행됩니다. 다음을 출력합니다 :

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:

/opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password' /opt/local/lib/mysql5/bin/mysqladmin -u root -h LeoMacBook.local password 'new-password'

Alternatively you can run: /opt/local/lib/mysql5/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 /opt/local ; /opt/local/lib/mysql5/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl cd /opt/local/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /opt/local/lib/mysql5/bin/mysqlbug script!

이제 ... 지침을 정확히 따르겠습니다. 서버를 시작합니다 :

sudo /opt/local/lib/mysql5/bin/mysqld_safe &

서버가 정상적으로 작동 중입니다. 내가 루트 암호를 변경하려고하면

, 나는에 로그인 할 수 없습니다. 나는 지혜의 끝에있어

LeoMacBook:bin leonardteo$ /opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password' /opt/local/lib/mysql5/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'

합니다.

--skip-grant-tables를 사용하여 서버를 시작했습니다. 이것으로, 나는 명령 줄에서 MySQL을 잘로드 할 수 있고 나는 서버에 연결되어있다. SELECT * FROM mysql.user;를 실행하면 빈 세트가 반환됩니다! 이걸로 나는 다음 명령을 호출하여 새 사용자를 만들려고 시도했다.

CREATE USER 'root'@'localhost' IDENTIFIED BY 'root';

그러나 이것은 작동하지 않는다.

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

나는이 작업을 얻을 수 없다 : 나는 오류가 발생합니다. 내가 가까이에있는 것처럼 보이지만 루트 사용자가 누락 된 것 같습니다.

아이디어가 있으십니까?

레너드

당신이 --skip-그랜트 테이블, 발행 flush privileges; 쿼리를 MySQL의를 시작하면

답변

4

. 이렇게하면 권한 시스템이 다시 활성화되어 일반 grantcreate user 개의 검색어를 실행할 수 있습니다.

+1

빙고. 고마워. 마크. 다른 십사 가지를 시도하기 전에 오랫동안 질문을해야합니다 ..... –

관련 문제