Category: Database
Eclipse | Ctrl+click doesn’t redirect to parent function or class
While working in eclipse, we faced a problem in which Ctrl+click was not redirecting to the parent function or class. Solution: To solve this problem, we followed the below steps : 1. Exit Eclipse 2. Go to Workspace 3. Open
Mysql | How to access database remotely
To access Mysql database remotely a good way is to create a new Mysql user and grant it permissions to access database from remote, as explained below: You can create user with two ways From Mysql command prompt: 1. Open
SQL Server / MySQL | Combine data from multiple rows into a single row
We have data as below: We need output like this: Solution: For SQL server STUFF function is the key here: SELECT Id,STUFF( ( SELECT distinct ‘ ‘ + cast(Name as varchar(500)) from table1 t2 where t1.Id = t2.Id FOR XML
Mysql | Maximum execution time of 360 seconds exceeded at data import time
In one of the project we had to import some .csv files into Mysql database. Files were of size 80mb and more. When we tried to upload the files through phpmyadmin it was resulting in timeout error – Maximum execution
Joomla- Database Error: Unable to connect to the database
While working with Joomla if you get an error – “Database Error: Unable to connect to the database:Could not connect to database”, check following properties in Joomla’s configuration.php file : //given values are sample data only. var $dbtype = ‘mysql’;
Moodle | Fetch all the categories based on the programs assigned to a user
Below are the Moodle database tables that will be used to fetch all the categories based on the programs assigned to a user (complete query is also written after table information): 1. mdl_prog : This table contains each program along
Mysql | Forgot root password in Mysql
If you forget mysql root password these are few easy steps to regain access: 1. shell> mysqld_safe –skip-grant-tables 2.Open another terminal shell> mysql -u root -p (hit enter and use blank password) 3. mysql>UPDATE mysql.user SET Password=PASSWORD(‘NewPassword’)WHERE User=’root’; 4. mysql>FLUSH
Couple of approaches to generate test-data in bulk
Sometimes you need to fill a database table with thousands of test data records. You may also need to generate test data in the form of csv file to feed to a program. How can you generate such a large
Moodle | Call to undefined method mysqli_native_moodle_database :: insert_records()
We were using insert_records() function to insert multiple records in a Moodle database table but it was not working. We checked for errors by adding following lines in config.php file of moodle: @error_reporting(E_ALL | E_STRICT); @ini_set(‘display_errors’, ‘1’); $CFG->debug = (E_ALL