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

  • SEARCH
  • Home
  • 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 6622007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:20:52+00:00 2026-05-25T21:20:52+00:00

I have a MySQL server running on my Windows machine, and I wanted to

  • 0

I have a MySQL server running on my Windows machine, and I wanted to add users capable of connecting from any host to it. In order to do so I used the statement

CREATE USER ‘user_name’@’%’ IDENTIFIED BY ‘user_pw’

but when I try to connect locally with this new user, it fails. Right now I solved the problem by calling CREATE USER twice, the first using ‘%’ as host and the second using ‘localhost’, but I’d like to know if there’s another solution or some option I have to change on the server

  • 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-05-25T21:20:52+00:00Added an answer on May 25, 2026 at 9:20 pm

    Taken from here:

    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';
    

    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 5.4.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

On a Windows 7 machine running MySQL server 5.1.51 (both 64bit), before migrating to
MySQL 5.1.31 running on Windows XP. From the local MySQL server (192.168.233.142) I can
I have MySQL installed on a Windows 2003 server on our domain. I cannot
I have to migrate a table from MSSQL Server to MySql. The problem is
I had a server running on a Windows XP machine using Apache2 with PHP
We are running MySQL on a Windows 2003 Server Enterpise Edition box. MySQL is
Windows Server 2003. I have an existing DotNetNuke website. SQL Server is currently running
i have a virtual ubuntu server running in windows 7 pro using VMware Player.
Since a few days ago, MySQL server on my Windows machine was not successful
I have a mysql instance (and schema) running on windows that I can access

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.