Cannot connect to MySQL server over network
Check /etc/my.cnf and make sure you are listening for outside connections. edit the line that starts with bind-address**************************************************************************
change:
to:Code:bind-address = 127.0.0.1
make sure mysql is running:Code:#bind-address = 127.0.0.1
if not, start it:Code:/etc/init.d/mysql status
check if the ubuntu firewall is runningCode:/etc/init.d/mysql start
if it is, allow mysqlCode:sudo ufw status
Code:sudo ufw allow mysql
Possibly a security precaution. You could try adding a new administrator account:
Although as Pascal and others have noted it's not a great idea to
have a user with this kind of access open to any IP. If you need an
administrative user, use root, and leave it on localhost. For any other
action specify exactly the privileges you need and limit the
accessibility of the user as Pascal has suggest below.From the MySQL FAQ: If you cannot figure out why you get Access denied, remove from the user table all entries that have Host values containing wildcards (entries that contain '%' or '_' characters). A very common error is to insert a new entry with Host='%' and User='some_user', thinking that this allows you to specify localhost to connect from the same machine. The reason that this does not work is that the default privileges include an entry with Host='localhost' and User=''. Because that entry has a Host value 'localhost' that is more specific than '%', it is used in preference to the new entry when connecting from localhost! The correct procedure is to insert a second entry with Host='localhost' and User='some_user', or to delete the entry with Host='localhost' and User=''. After deleting the entry, remember to issue a FLUSH PRIVILEGES statement to reload the grant tables. See also Section 5.4.4, “Access Control, Stage 1: Connection Verification”. |
No comments:
Post a Comment