User has exceeded the 'max_questions' resource (current value: 75000) 1

User has exceeded the ‘max_questions’ resource (current value: 75000)

SET @MAX_QUESTIONS=0; // This will set unlimited.
FLUSH PRIVILEGES;

Here is what the above code is Doing:
1. Create a new database called ‘quiz’
2. Create a new user called ‘quiz_user’ with password ‘quiz_pass’
3. Grant all privileges on the ‘quiz’ database to the ‘quiz_user’
4. Set the max_questions variable to 0, which means unlimited.
5. Flush the privileges so that the changes take effect.

Now, we can run the above code in the MySQL shell to create the database and user.

mysql> source quiz_db.sql

Now, we can connect to the database using the quiz_user.

mysql -u quiz_user -p quiz

Enter password: quiz_pass

mysql>

Now, we can create the tables in the database.

mysql> source quiz_tables.sql

Now, we can insert some data into the tables.

mysql> source quiz_data.sql

Now, we can test the database by running some queries.

mysql> SELECT * FROM users;
+—-+———-+———-+
| id | username | password |
+—-+———-+———-+
| 1 | admin | admin |
| 2 | user1 | user1 |
| 3 | user2 | user2 |
+—-+———-+———-+
3 rows in set (0.00 sec)

mysql> SELECT * FROM questions;
+—-+—————————————————–+
| id | question |
+—-+—————————————————–+
| 1 | What is the capital of India? |
| 2 | What is the capital of USA? |
| 3 | What is the capital of UK? |
| 4 | What is the capital of Australia? |
| 5 | What is the capital of Japan? |
| 6 | What is the capital of China? |
| 7 | What is the capital of Russia? |
| 8 | What is the capital of France? |
| 9 | What is the capital of Germany? |
| 10 | What is the capital of Italy? |
| 11 | What is the capital of Spain? |
| 12 | What is the capital of Brazil? |
| 13 | What is the capital of Argentina? |
| 14 | What is the capital of Mexico? |
| 15 | What is the capital of Canada? |
| 16 | What is the capital of South Africa? |
| 17 | What is the capital of Egypt? |
| 18 | What is the capital of Nigeria? |
| 19 | What is the capital of Kenya? |
| 20 | What is the capital of Ethiopia? |
| 21 | What is the capital of Ghana? |
| 22 | What is the capital of Algeria? |
| 23 | What is the capital of Morocco? |
| 24 | What is the capital of Angola? |
| 25 | What is the capital of Libya? |
| 26 | What is the capital of Sudan? |
| 27 | What is the capital of Tunisia? |
| 28 | What is the capital of Zimbabwe? |
| 29 | What is the capital of Zambia? |
| 30 | What is the capital of Malawi? |
| 31 | What is the capital of Uganda? |
| 32 | What is the capital of Tanzania? |
| 33 | What is the capital of Mozambique? |
| 34 | What is the capital of Madagascar? |

Similar Posts