Phpmyadmin set user privileges

How to create new WP user and manage the user privilege via PhpMyAdmin?

Step 1: Login to the cPanel.
Step 2: In cPanel go to phpMyAdmin menu in Databases section.
Step 3: Select the required database in the list. You can check the database name of your installation in wp-config.php file.
Step 4: Select the wp_users table, locate the account role you want to change and memorize its ID, you will need it later.
Step 5: Now go to the wp-usermeta table, click on Search. Input the user ID into the ‘user_id’ field and ‘wp_capabilities’ into the meta_key field and click on ‘Go’.
Step 6: You will see a database cell containing a record specifying the current Role of the user.
Step 7: On the next page, you will need to replace the current meta_value with the new one according to the role you need,

a:1:{s:10:”subscriber”;b:1;} – Subscriber
a:1:{s:11:”contributor”;b:1;} – Contributor
a:1:{s:6:”author”;b:1;} – Author
a:1:{s:6:”editor”;b:1;} – Editor
a:1:{s:13:”administrator”;b:1;} – Administrator

Step 8: Click ‘Go’ to complete the setup.

  • How to clone my WordPress site?
  • How to track the visitor count on my website in WordPress?
  • How to Restore clone backup my WordPress site?
  • Steps to add an ‘About’ page on a WordPress website?
  • How to Restore or clone backup my WordPress site?
  • How to define PHP memory limit in WordPress

To begin editing privileges in MySQL, you must first login to your server and then connect to the mysql client. Typically you’ll want to connect with root or whichever account is your primary, initial ‘super user’ account that has full access throughout the entire MySQL installation.

Typically the root user will have been assigned an authentication password when MySQL was installed, but if that is not the case, you should take steps to up your security by adding root passwords as illustrated in the official documentation.

Connecting to the MySQL Command-Line Tool

For this example, we’ll assume root is the primary MySQL account. To begin using the MySQL Command-Line Tool (

$ mysql --user=username
1), connect to your server as the root user, then issue the mysql command:

$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 112813
Server version: 5.5.43-0ubuntu0.14.04.1 (Ubuntu)
[...]
mysql>

If successful, you’ll see some output about your MySQL connection and be facing down the mysql prompt.

Note: In the event that you’re unable to connect directly to the server as the root user before connecting to mysql, you can specify the user you wish to connect as by adding the

$ mysql --user=username
7 flag:

$ mysql --user=username

Granting Privileges

Now that you are at the

$ mysql --user=username
1 prompt, you need only issue the
$ mysql --user=username
9 command with the necessary options to apply the appropriate permissions.

Privilege Types

The

$ mysql --user=username
9 command is capable of applying a wide variety of privileges, everything from the ability to
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
1 tables and databases, read or write
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
2, and even
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
3 the server. There are a wide range of flags and options available to the command, so you may wish to familiarize yourself with what
$ mysql --user=username
9 can actually do by browsing through the official documentation.

Database-Specific Privileges

In most cases, you’ll be granting privileges to MySQL users based on the particular

mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
5 that account should have access to. It is common practice, for example, for each unique MySQL
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
5 on a server to have its own unique
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
7 associated with it, such that only one single
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
7 has authentication access to one single
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
5 and vice-versa.

To

mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
0 privileges to a
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
7, allowing that user full control over a specific
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
5, use the following syntax:

mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';

With that command, we’ve told MySQL to:

  • $ mysql --user=username
    
    9 the
    mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
    
    4 of type
    mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
    
    5 (thus everything of course). Note: Most modern MySQL installations do not require the optional
    mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
    
    4 keyword.
  • These privileges are for
    mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
    
    7 and it applies to all tables of that database, which is indicated by the
    mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
    
    8 that follows.
  • These privileges are assigned to
    mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
    
    9 when that
    mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
    
    9 is connected through locally, as specified by
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
    
    1. To specify any valid host, replace
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
    
    2 with
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
    
    3.

Rather than providing all privileges to the entire database, perhaps you want to give the

mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
4 user only the ability to read data (
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
5) from the
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
6 table of the
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
7 database. That would be easily accomplished like so:

mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';

Creating Another Super User

While not particularly secure, in some cases you may wish to create another ‘super user’, that has ALL privileges across ALL databases on the server. That can be performed similar to above, but by replacing the

mysql> GRANT ALL PRIVILEGES ON books.authors  TO 'tolkien'@'localhost';
7 with the wildcard asterisk:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';

Now

mysql> GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
4 has the same privileges as the default root account, beware!

Saving Your Changes

As a final step following any updates to the user privileges, be sure to save the changes by issuing the

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
1 command from the mysql prompt:

How to give privileges to user in phpMyAdmin?

Add a user account.
On the phpMyAdmin screen, select User accounts tab..
Select Add user account link..
Enter user name and password of your choice. ... .
Select Local for Host name..
Check Create database with same name and grant all privileges..
Check Grant all privileges on wildcard name (username\_%).

How to set user privileges in MySQL?

The GRANT statement allows you to set MySQL access permissions using the following syntax: mysql> GRANT privilege ON privilege_level TO account_name; Type the following to grant `SELECT` and `INSERT` privileges to a local user on the `strongdm` database: mysql> GRANT SELECT, INSERT ON strongdm.

How to set username and password for database in phpMyAdmin?

Click on the Add User Account link under New Section. Create user with a strong password. Grant Privileges. Now click on go button and phpMyAdmin will create the user and shows the SQL used to create the user.

How to set super privileges in phpMyAdmin?

How to I Set Super Privilege for a particular MYSQL User.
Login to WHM as root..
Click on phpMyAdmin option under SQL Services..
Click on users tab on the right side..
Choose the alphabet under where the user is created. ... .
Click on Edit Privilege link against that user..
Under Administration heading, check Super option and submit..