Home > Code > create a mysql user that can connect from anywhere to anything

create a mysql user that can connect from anywhere to anything

February 3rd, 2004 Tony Leave a comment Go to comments

Obviously this is a huge security mistake to create this on a production server but if you just want to be able to get to all databases on a remote server in your intranet its a necessity:

On the server:

Login as root: mysql -u root -p

Create user: GRANT ALL PRIVILEGES ON *.* TO myuser@’%’ IDENTIFIED BY ’some_password’ WITH GRANT OPTION;

Now you can login from another machine

mysql -h 192.168.0.100 -u myuser -p

Categories: Code Tags:
  1. Rodrigo
    April 16th, 2007 at 08:52 | #1

    Hello,

    I’ve tried this command to make a new user, however I just got:

    “Query OK, 0 rows affected (0.00 sec)”

    Then I think “ok, 0 rows, it seems I already built this user before”. However, it doesn’t works, the user isn’t created, therefore I cannot log-in the new user.