2016-11-02 177 views
0

在amazon ec2新實例中安裝如下。
yum install -y httpd24 php56 mysql55-server php56-mysqlndAWS EC2 mysql root密碼問題

然後用mysqld start服務啓動了mysqld。它給出了需要執行的命令列表。

按照服務輸出中的說明更改根密碼。當下面的命令運行時,它給出了一個錯誤

/usr/libexec/mysql55/mysqladmin: connect to server at '177.37.1.30' failed 
error: 'Host 'ip-177-37-1-30.ap-southeast-1.compute.internal' is not allowed to connect to this MySQL server' 

如何解決這個問題?

service mysqld start 
Initializing MySQL database: Installing MySQL system tables... 
161102 4:22:07 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.52) starting as process 3137 ... 
OK 

Filling help tables... 
161102 4:22:07 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.52) starting as process 3144 ... 
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/libexec/mysql55/mysqladmin -u root password 'new-password' 
/usr/libexec/mysql55/mysqladmin -u root -h ip-177-37-1-30 password 'new-password' 

Alternatively you can run: 
/usr/libexec/mysql55/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 ; /usr/libexec/mysql55/mysqld_safe & 

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

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

請看看這個[鏈接](http://stackoverflow.com/questions/19101243/error-1130-hy000-host-is-not-allowed-to-connect-to-this-mysql-server ) , 希望能幫助到你 – akhila

回答

0

在實例正在運行的VPC中授予Nat權限。 謝謝。