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 command prompt.
2. Open the terminal of MYSQL Read more…
We have data as below:
We need output like this:
For SQL server
STUFF function is the key here:
SELECT distinct ‘ ‘ + cast(Name as varchar(500)) from table1 t2 where t1.Id = t2.Id FOR XML PATH(”), TYPE ).value(‘.’, ‘NVARCHAR(MAX)’) ,1 Read more…
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 time of 360 seconds exceeded (see image below):
A better solution Read more…
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’;
var $host = ‘localhost’;
var $user = ‘user_jo151’;
var $password = ‘YourPassword’;
var Read more…
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 with the category to which program belongs, its summary, fullname and Read more…
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 Read more…
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 set of data in short time?
One approach to generate Read more…
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);
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = 1 Read more…
In one case we noticed that SQL Server (SQL Server 2014) service was scheduled to start Automatically on system boot but still it was not starting up. It did not even start when we manually tried to start the service. We got following errors:
Error1: A timeout was reached (30000 Read more…
We had a table in our database having dot in the table name as below:
Table name – kpc.product_categories
On trying to delete kpc.product_categories using below command:
drop table kpc.product_categories
It used to give error that no such table exists.
Dot(.) is the reserved symbol in mysql so Read more…
Following are the steps to delete the Postgres database backup:
1. Login into heroku.
2. Click on the database>PG Backups. Here you can see all the PG backups list.
3. . For deleting the database, first of all you have to install the toolbelt.
You can download Toolbelt from Read more…
This is a simple idea to reduce API calls consumption when you pull data from Zoho CRM into an integrated piece of code (like server side code in PHP or Java that connects to Zoho CRM to retrieve records). In one of the projects we were working on, we had Read more…
To see the database backup retained limit see the steps followed below:
1. Login into heroku.
2.Now click the database you are using. As you can see in the below screenshot database name is Heroku Postgres – Charcoal and it is Hobby Basic and it is purchased with Read more…
Recently in a website we were developing in Codeigniter PHP Framework, some of the urls stopped working and started throwing 500 internal server error. On investigation we found a MySQL query which was causing the problem .Query is simple but when we ran it Read more…
In previous 2 posts in this series we covered benefits of having a website for your business and difference between Responsive and Non-Responsive website. We also shared some stats on how small business presence on Internet is going up.
In this third and final post of “Importance of Website Read more…
Inside $tomcat_home/conf/context.xml add this inside <Context>
<Resource name=”jdbc/datasourcename” auth=”Container” type=”javax.sql.DataSource” maxActive=”100″ maxIdle=”30″ maxWait=”1000″ username=”dbuser” password=”dbpwd” driverClassName=”com.mysql.jdbc.Driver” url=”jdbc:mysql://localhost:3306/exodus”/>
Now restart tomcat
Inside Read more…
That’s the error you get for oracle user for whom password is expired.
One Solution – Connect using sqlplus to set new password, you can even use the same password you had earlier.
SQL*Plus: Release 126.96.36.199.0 Production on Mon Dec 13 01:12:07 Read more…