How To Manually Create A Database and User Print

  • 0

 

How to Create a New User and Database in phpMyAdmin

 

---------------------------------------------

Complete ready to go command prompt 

-------------------------------------------

CREATE USER 'USERNAME-HERE'@'%' IDENTIFIED BY 'PASSWORD-HERE'; GRANT ALL PRIVILEGES ON DATABASE-HERE.* TO 'USERNAME-HERE'@'%';

 

The Full Breakdown Of How To Do This

Creating a new user and database in phpMyAdmin is a straightforward process. Follow these step-by-step instructions to set up a new user and assign a database to that user.

#### Step 1: Log into phpMyAdmin
Start by logging into your phpMyAdmin panel. This typically requires a username and password, which you should have received from your hosting provider.

#### Step 2: Open the SQL tab
Once logged in, click on the SQL tab from the top menu. This allows you to execute SQL commands directly.

#### Step 3: Create a New User
Copy and paste the following SQL command into the SQL command box to create a new user. Be sure to replace `USERNAME-HERE` with the desired username and `PASSWORD-HERE` with a strong password.

sql
CREATE USER 'USERNAME-HERE'@'%' IDENTIFIED BY 'PASSWORD-HERE';


Click the "Go" button to execute the command.

#### Step 4: Create a Database
Next, create a database that this user will access. Replace `DATABASE-HERE` with the name of your new database:

```sql
CREATE DATABASE DATABASE-HERE;
```
Click "Go" to create the database.

#### Step 5: Grant Privileges
Now, assign the appropriate privileges to the new user for the database you just created. Replace `DATABASE-HERE` and `USERNAME-HERE` as necessary:

```sql
GRANT ALL PRIVILEGES ON DATABASE-HERE.* TO 'USERNAME-HERE'@'%';
```
Execute this command by clicking "Go".

#### Step 6: Apply the Changes
To ensure all changes take effect immediately, flush the privileges:

```sql
FLUSH PRIVILEGES;
```
Click "Go" to execute.

#### Step 7: Verify the Setup
To confirm that your new user and database are set up correctly, log out from phpMyAdmin and try logging in with the new user credentials. Attempt to access the new database to ensure all privileges are correctly assigned.

### Conclusion
You have successfully created a new user and database in phpMyAdmin! This new user now has full access to the database, allowing for database operations such as modifying, inserting, and retrieving data.

---

 


Was this answer helpful?

« Back