| GRANT ALL PRIVILEGES ON `dbname`.* TO | If you want to view the privileges assigned to the MySQL user account, run the following command: mysql> SHOW GRANTS FOR should see the following output: - mysql> FLUSH PRIVILEGES View MySQL User Account Privileges To grant all privileges to the MySQL user account on a specific database, run the following command: mysql> GRANT ALL PRIVILEGES ON dbname.* TO grant all privileges to the MySQL user on a specific table from a database, run the following command: mysql> GRANT ALL PRIVILEGES ON dbname.tablename TO grant multiple privileges like, SELECT, INSERT, DELETE to the MySQL user on a specific database, run the following command: mysql> GRANT SELECT, INSERT, DELETE ON dbname.* TO will need to run the flush privileges command for the changes to take effect. GRANT OPTION: – This will allow MySQL users to grant or remove other users’ privileges.UPDATE: – This will allow MySQL users to update table rows.SELECT: – This will allow MySQL users to read a database.INSERT: – This will allow MySQL users to insert rows to a specific table.DROP: – This will allow MySQL users to drop databases and tables.DELETE: – This will allow MySQL users to delete rows from the table.CREATE: – This will allow MySQL users to create databases and tables.ALL PRIVILEGES: – This will allow MySQL users to run any query on the specified database.Some of the most commonly used permissions are shown below: There are multiple types of permissions available in MySQL that you can provide to the MySQL user account. 192.168.0.100 is the IP address of the remote server.In that case, you can create a new MySQL user with the following command: mysql> CREATE USER IDENTIFIED BY 'userpassword' You will need to replace the localhost with the remote server IP address if you want to connect the MySQL from the remote server. localhost is a host from where you want to connect to MySQL.userpassword is the password of the MySQL user.username is the name of the MySQL user you want to create.Now, create a new MySQL user with the following command: mysql> CREATE USER IDENTIFIED BY 'userpassword' Type '\c' to clear the current input statement. Other names may be trademarks of their respective Oracle is a registered trademark of Oracle Corporation and/or itsĪffiliates. Once you are connected to the MySQL shell, you should see the following output: Welcome to the MySQL monitor. You will be asked to provide your MySQL root password. You can connect it using the following command: mysql -u root -p You can do this by running the following commands: apt-get update -yĪpt-get upgrade -y Create a New MySQL Userįirst, you will need to connect to the MySQL shell using the MySQL root user. Additionally, replace ‘root’ with the username of the admin account if necessary.īefore starting, you have to make sure that all OS packages installed on the server are up to date. You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Log in to the Server
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |