Архиви на блога

most userful joomla function to debug database query

// Get a db connection. $db = JFactory::getDbo();   // Create a new query object. $query = $db->getQuery(true);   // Select all articles for users who have a username which starts with ‘a’. // Order it by the created date.

С етикет: , , , , , ,
Публикувано в Joomla

mysql Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.

If you get some errors like this you need to open your home directory vim ~/.my.cnf and change on the row pass= to password=

С етикет: , , , , , ,
Публикувано в linux

mysql server has gone away or connection timeout

If you do a lots of things in one php script this usually takes some time and mysql can gone away 😉 for this when you run new query you can run it with this function which will connect again

С етикет: , ,
Публикувано в linux, php

mysql import all sql files from directory

for SQL in *.sql; do  echo importing $SQL; mysql -u user  -ppassword table< $SQL;rm $SQL; done

С етикет: , , , , , ,
Публикувано в linux

mysql export every table in different file

#!/bin/bash # dump-tables-mysql.sh # Descr: Dump MySQL table data into separate SQL files for a specified database. # Usage: Run without args for usage info. # Author: @Trutane # Ref: http://stackoverflow.com/q/3669121/138325 # Notes: # * Script will prompt for password

С етикет: , ,
Публикувано в linux