Subject: How to enable remote access to MySQL?
Author: Linux
In response to: Install and configure MySQL on AWS EC2 instance
Posted on: 10/26/2011 02:05:35 AM
Connect to mysql server:
$ mysql -u root -p secret
Create a new database called
foo
mysql> CREATE DATABASE foo;
If you want database
foo to be accessed by user
bar from remote ipAddress
12.34.56.78, then you need to type the following command
mysql> GRANT ALL ON foo.* TO bar@'12.34.56.78' IDENTIFIED BY 'secret';
>
> On 10/26/2011 01:28:13 AM
Linux wrote:
Heres how to do that:
$ sudo yum list | grep mysql*
$ sudo yum install mysql
$ sudo yum install mysql-server
$ sudo yum install mysql-devel
$ sudo chgrp -R mysql /var/lib/mysql
$ chmod -R 770 /var/lib/mysql
$ sudo service mysqld start
Now youll have MySQL installed and the service has started. The next step is to set a password for the root user:
$ usr/bin/mysqladmin -u root password secret
If you only want to use MySQL internally, then youre all done now.
But if you access MySQL externally then youll get the error message similar like this:
SQL Error (1130): Host 'adsl-71-146-123-45.sbcglobal.net' is not allowed to connect to this MySQL server
References: