Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:55:13+00:00 2026-06-02T03:55:13+00:00

I had been using SQL Server and am now using MySQL for a project.

  • 0

I had been using SQL Server and am now using MySQL for a project. With SQL Server, our developers can connect to the remote database on their local machines if they know the host, username, password. With MySQL, though, to give a developer access from their local machines, I have been having to log in to MySQL and execute:

GRANT ALL ON *.* to user@address IDENTIFIED BY 'password'; 
flush privileges;

Where address is the IP address of the developer’s machine. Of course, if they change networks, I have to execute it again. Is there a way to allow all remote connections like I have experienced with SQL Server, or is this a bad idea for some reason? We have username and password still.. I’m obviously a little confused.

Also: this is a development database and is only accessible from our internal network. I understand why it is a bad idea to give everyone access to a production database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:55:14+00:00Added an answer on June 2, 2026 at 3:55 am

    As pointed out by Ryan above, the command you need is

    GRANT ALL ON *.* to user@'%' IDENTIFIED BY 'password'; 
    

    However, note that the documentation indicates that in order for this to work, another user account from localhost must be created for the same user; otherwise, the anonymous account created automatically by mysql_install_db takes precedence because it has a more specific host column.

    In other words; in order for user user to be able to connect from any server; 2 accounts need to be created as follows:

    GRANT ALL ON *.* to user@localhost IDENTIFIED BY 'password'; 
    GRANT ALL ON *.* to user@'%' IDENTIFIED BY 'password'; 
    

    Read the full documentation here.

    And here’s the relevant piece for reference:

    After connecting to the server as root, you can add new accounts. The
    following statements use GRANT to set up four new accounts:

    mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
        ->     WITH GRANT OPTION;
    mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
        ->     WITH GRANT OPTION;
    mysql> CREATE USER 'admin'@'localhost';
    mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
    mysql> CREATE USER 'dummy'@'localhost';
    

    The accounts created by these statements have the following
    properties:

    Two of the accounts have a user name of monty and a password of
    some_pass. Both accounts are superuser accounts with full privileges
    to do anything. The ‘monty’@’localhost’ account can be used only when
    connecting from the local host. The ‘monty’@’%’ account uses the ‘%’
    wildcard for the host part, so it can be used to connect from any
    host.

    It is necessary to have both accounts for monty to be able to connect
    from anywhere as monty
    . Without the localhost account, the
    anonymous-user account for localhost that is created by
    mysql_install_db would take precedence when monty connects from the
    local host. As a result, monty would be treated as an anonymous user.
    The reason for this is that the anonymous-user account has a more
    specific Host column value than the ‘monty’@’%’ account and thus comes
    earlier in the user table sort order. (user table sorting is discussed
    in Section 6.2.4, “Access Control, Stage 1: Connection Verification”.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Microsoft SQL Server. I have a Table which had been updated
We have been using sql server 2005 during development and have had no real
I recently had to switch from using Microsofts SQL server to using MySQL. The
I'm working on a web project. I'm using a Sql Server 20008 R2 database
We are trying to get quaqua out of our application. We had been using
I've been using prepared statements for a little while now and I've never had
Rails 3.1, Ruby 1.9.2, using a SQL Server 2008 database through the activerecord-sqlserver-adapter gem.
I'm having trouble saving an entity into an SQL Server 2005 database. I'm using
I am working on a project which uses a relational database (SQL Server 2008).
Our .LDF (SQL Server Database Transaction Log File) has grown to 45GB over the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.