How to Grant Access to a MySQL Database

MySQL is a database system that gives many people access to many databases. As the database administrator, you can grant access so that a new user can create, remove, update, and delete records. Stored data is inserted, updated, and queried using Standard Query Language; hence the name MySQL. MySQL users have several options for accessing the server that hosts the databases, including from the server itself, through the Internet, or remotely from an outside private network.

Instructions

    • 1

      Ascertain that the user to whom you want to grant access has already been created. Let's say that "Fred" is the new user name and the name has been created in your database.

    • 2

      Make sure you know the name of the database that you want Fred to have access to. Let's say the name of the database is "recruitment."

    • 3

      Get the Internet protocol address of the machine from which Fred will be accessing the database. If Fred will be accessing the database from the computer that the database is on, then the IP address would be "localhost" instead of a normal IP address.

    • 4

      Log on as the administrator to the MySQL database using your admin user name and password. The mysql prompt will appear.

    • 5

      Enter the command that grants user access to the database by typing the following:

      GRANT ALL PRIVILEGES ON database.* to user@'host.'

      Using the example of Fred, if he needs access to a database on his own computer, type the following:

      GRANT ALL PRIVILEGES ON recruitment.* to fred@'localhost'.

      Fred now has access to all tables in the recruitment database on his computer. If you want Fred to access the MySQL database from any machine, you can provide access from the 192.168.10.0 to 192.168.10.255 range of IP addresses by typing the following:

      GRANT ALL PRIVILEGES on recruitment.* to fred@'192.168.10.0/255.255.255.0'

Related Searches:

References

Resources

Comments

  • judlee Apr 05, 2009
    Granting access to a MySQL database has been a mystery to me. No longer! Thanks for adding to my education today.

You May Also Like

  • MySQL and Access Tutorial

    Microsoft Access is a desktop application that allows users to create database records. The MySQL and Access software can be joined together...

  • How to Open MySQL Database With MS Access

    MySQL is a popular open-source database that is used in many different applications, especially Web-based applications. You can go through a MySQL...

  • How to Set Up MySQL Remote Access

    Remote access allows users and applications to connect to a MySQL database from a location other than the server running the database....

  • How to Build a Database

    Building a database using the MySQL command line interface is a quick and easy method that many administrators use whenever possible. The...

  • How to Convert Access to MySQL

    Microsoft Access database files can be easy to manipulate. But networking the files, especially large ones, is not so easy. Making them...

  • How to Change a MySQL Privilege Table

    Accomplish this with the three-part GRANT command from the root user. To change privileges, GRANT needs to command who has access privileges...

  • How to Access My Security Camera Online

    Home security is becoming very popular, and many people are saving money on home security systems by installing them on their own....

  • How to Set Up Home Web Servers

    Setting up your own website often means paying a hosting company to host your website. If you have a broadband Internet connection,...

  • How to Remove Select Grant Microsoft SQL Database Table

    Microsoft SQL Server is a Relational Database Management System RDMS which includes rich built in security features. Granting and revoking specific rights...

  • MySQL Create a Database Tutorial

    When you first start the MySQL server, you must create a blank database and fill it with tables. Before setting up the...

Related Ads

Featured