Category: mysql
How to get the auto incremented id after adding the data in mysql
In one of the project we were working on, we had a situation, where we need to add a record to the table of the database. The added record id is auto incremented in database. This id needs to added to another table with some more data. Now the issue here is how to get…
Read MoreHow to check and change innodb buffer pool size in mysql database
The InnoDB buffer pool size in MySQL determines how much memory is allocated to store frequently accessed data and indexes. To check and change it, follow these steps: 1. Check Current InnoDB Buffer Pool Size Log in to MySQL mysql -u root -p Run the Following Query SHOW VARIABLES…
Read MoreSetting of Auto backup of Mysql database in a laravel project
When we work on any database project, it’s always good to set up autoback of the database on daily basis. We can set up a cron job for backing up a MySQL database in a Laravel project, follow these steps: 1. Create a Laravel Artisan Command Run the following command to create a custom Artisan command:…
Read MoreDo’s and Don’t for a database maintenance
Here I have listed some do’s and don’ts for a database project. Do’s for a Database Maintenance Project: 1. Regularly perform database backups to prevent data loss in case of system failures or disasters. 2. Monitor database performance metrics such as CPU usage, memory usage, and disk I/O to identify potential bottlenecks. 3. Implement database…
Read MoreHow to get the table name with a required column name in MySQL using query
While working on a project we had a big database which contains more than 250 tables. I wanted to get the table name containing a column say “Column A”. We can do it easily with a query. Say now we have a database called as “Test_Database” with lot of tables and columns. Now I want…
Read MoreHow to find the next set of records after a specified one in MYSQL
Greetings Of The Day! While we were working with web services using PHP and Mysql for an android application, we had a use case to retrieve and show a set of data to one user and remaining set of data to other user based on the login details. Application had Master and Partner users. Consider…
Read More