AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() user The name of the user that will have these privileges revoked. ![]() In the case of revoking privileges on a table, this would be the table name. Object The name of the database object that you are revoking privileges for. For example: GRANT SELECT ON contacts TO to perform SELECT statements on the table. For example: GRANT ALL ON contacts TO you wanted to grant only SELECT access on the contacts table to all users, you could grant the privileges to *. Let's look at some examples of how to grant privileges on tables in MySQL.įor example, if you wanted to grant SELECT, INSERT, UPDATE, and DELETE privileges on a table called contacts to a user name smithj, you would run the following GRANT statement: GRANT SELECT, INSERT, UPDATE, DELETE ON contacts TO can also use the ALL keyword to indicate that you wish to grant all permissions except GRANT OPTION to a user named smithj. user The name of the user that will be granted these privileges. In the case of granting privileges on a table, this would be the table name. Object The name of the database object that you are granting permissions for. Grants all permissions except GRANT OPTION. Check the MySQL official getting started guide.Ability to perform SELECT statements on the table.Ībility to perform INSERT statements on the table.Ībility to perform UPDATE statements on the table.Ībility to perform DELETE statements on the table.Ībility to create an index on an existing table.Ībility to perform CREATE TABLE statements.Ībility to perform ALTER TABLE statements to change the table definition.Ībility to perform DROP TABLE statements.Īllows you to grant the privileges that you possess to other users. Some applications require specific privileges in the database. TIP: Check the MySQL version with the command /opt/bitnami/mysql/bin/mysqladmin -version or /opt/bitnami/mysql/bin/mysqld -versionĬreate a new user (with remote access) and grant privileges to this user on the new database.Īfter modifying the MySQL grant tables, execute the following command in order to apply the changes: mysql> flush privileges Mysql> grant all privileges on DATABASE_NAME.* TO your stack ships an older version of MySQL: mysql> grant all privileges on DATABASE_NAME.* TO identified by 'PASSWORD' If your stack ships MySQL v8.x: mysql> create user identified by 'PASSWORD' The local user can be used only for local connections (connections originating from the same host), while the remote user can be used for external connections (connections originating outside the host).Ĭreate a new database: mysql> create database DATABASE_NAME Ĭreate a new user (only with local access) and grant privileges to this user on the new database. The commands below create both a local user and a remote user. Then, follow the steps below to create a new database and user for your applications. Log in to the database server using the MySQL client and the correct credentials. The output of the command indicates which database server (MySQL or MariaDB) is used by the installation, and will allow you to identify which guides to follow in our documentation for common database-related operations. To identify which database server is used in your stack, run the command below: $ test -d /opt/bitnami/mariadb & echo "MariaDB" || echo "MySQL" On account of these changes, the file paths and commands stated in this guide may change depending on whether your Bitnami stack uses MySQL or MariaDB. NOTE: We are in the process of modifying the configuration for many Bitnami stacks.
0 Comments
Read More
Leave a Reply. |