Unable to login to MySQL instance hosted on AWS ec2
I am trying to set up a 开发者_StackOverflow中文版mysql
database on an aws ec2 instance (SUSE 32-bit with mysql pre-installed). However, I can't log in to mysql as root user:
mysql -u root
Access denied
without a password, so is there a way of getting one? I believe that root user is blocked and hence should login with ec2-user
. However, when I do
mysql -u ec2-user
the user does not have the priviledges to create a database.
I'm a not very familiar with linux, so if I'm simply doing this completely wrong, then do say.
Any help would be greatly appreciated.
The fact that this server is on EC2 is irrelevant. SUSE and MySQL do not know this. Amazon cannot block anything, you have root access to the server. You recover/change the root password the same as any server, with mysqladmin, or by starting mysqld with --skip-grant-tables
while you make the change.
mysql -u root -p
Then press enter.
I know, this isn't a direct answer to your question, but I would recommend using the AWS Relational Database Service. Amazon will host a MySQL database for you and take care of all the setup, maintenance, scaling, backup, etc.
http://aws.amazon.com/rds/
精彩评论