Programming Tutorials

MySQL Tutorials

1. Use a dynamic table name in a SQL Server SELECT statement

By: Gren : 2023-05-26

Description: To use a dynamic table name in a SQL Server SELECT statement, you can utilize dynamic SQL using the EXEC or sp_executesql statement. Here's an example of how you can achieve it


2. Finding slow queries in MySQL - Enable slow query log.

By: Murali : 2023-05-17

Description: In MySQL, you can check which queries took longer to execute and potentially caused the server to slow down by enabling the Slow Query Log feature. The Slow Query Log records queries that take longer than a specified amount of time to execute. Here are the steps to enable and utilize the Slow Query Log


3. mysqldumpslow in MySQL - Summarize slow query log.

By: Murali : 2023-05-17

Description: In MySQL, you can check which queries took longer to execute and potentially caused the server to slow down by enabling the Slow Query Log feature. The Slow Query Log records queries that take longer than a specified amount of time to execute. Here are the steps to enable and utilize the Slow Query Log


4. Sample my.cnf (my.ini) for MySQL with 1GB RAM

By: Murali : 2023-05-17

Description: For a VM with 1GB memory running both MySQL and Apache, you'll need to configure MySQL to use an appropriate amount of memory to ensure optimal performance. Here's a sample my.cnf configuration that you can start with


5. sql if null then 0

By: Mary : 2023-05-02

Description: In SQL, you can use the IS NULL condition to check if a value is NULL. To return 0 when the value is NULL, you can use the COALESCE function or the IFNULL function, depending on the database system you are using.


6. Modify a auto_increment id column in mysql to accept a 5 digit random number instead

By: Peter : 2023-03-27

Description: You can modify the column definition to remove the auto-increment property and then set a default value of a randomly generated 5-digit number. Note that modifying a column in a production database can be a risky operation, so it is recommended that you make a backup of your data before making any changes. Also, be sure to test your changes thoroughly to ensure that they do not cause any unintended side effects.


7. Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access them.

By: Norman : 2011-09-23

Description: If you getting this error "Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access them." then probably, you are trying to execute a exe file or a program downloaded from the internet, or copied from another location. In Windows, a downloaded executable or a copied executable is automatically marked as blocked.


8. ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client

By: Emiley J. : 2011-03-18

Description: When you use mysql to login to a MySQL server, if you receive this error, then it is something to do with your password versions. To resolve it, do the following.


9. Changing the Structure of an Existing Table in MySQL

By: Sathya Narayana : 2010-10-24

Description: First you'll add the price field to the table, using the ADD command and specifying the properties of the field: mysql> ALTER TABLE book ADD (price INTEGER);


10. Inserting Data into Tables in MySQL

By: Sathya Narayana : 2010-10-24

Description: To do this, you need to use the INSERT INTO...VALUES command.