julio 28, 2010

Linux - PostgreSQL - FATAL: bogus data in lock file postmaster.pid

Problema:

Al intentar arrancar postgresql

-bash-4.1$ postmaster -D /path/to/data/

o con

$/etc/init.d/postgresql start

o con

$service postgresql start

da el error

FATAL: bogus data in lock file "postmaster.pid": ""


Solución:

$mv postmaster.pid a postmaster.pid.bak

y arrancar postgresql

$service postgresql start


.

julio 26, 2010

julio 15, 2010

Linux - Mysql - Table crashed

Problema:

#145 - Table is marked as crashed and should be repaired


Solución:

# mysqlcheck -u [usuario_root] -p --auto-repair [nombre_de_la_base]


.

Linux - PostgreSQL - Performance

http://gmod.org/wiki/PostgreSQL_Performance_Tips

Database initialization

One step that can be taken to optimize your PostgreSQL database is to properly initialize it with initdb. If you are using a PostgreSQL server that came with your OS or have installed it from some package system it may have already been initialized. In these cases you are probably better off removing the PostgreSQL data directory and reinitializing it manually.

To do this you need to execute the following command as the postgres user, or whatever user you use to run postgres under.

initdb -D /var/lib/pgsql/data --locale=C

Please note that the directory location is entirely dependent on your system or your specific setup and should be substituted with whatever convention is used in your situation. What this command does is explicitly initialize the PostgreSQL database with a C locale. If you do not specify the C locale it defaults to whatever your system is set to, which is set to 'en_US.UTF8' on many linux distributions. In these cases, queries with "LIKE" will take a performance hit because PostgreSQL will not use the indices as you would expect it to. Setting it to the C locale from the start eliminates this.

From the Locale Support page in the manual:

The drawback of using locales other than C or POSIX in PostgreSQL is its performance impact.
It slows character handling and prevents ordinary indexes from being used by LIKE.
For this reason use locales only if you actually need them.

If for some reason you cannot reinitialize your database you can also drop specific indexes that involve text fields and recreate them using operator classes.

* http://archives.postgresql.org/pgsql-performance/2007-05/msg00117.php

One other option you should consider is what the default encoding for all your databases should be. If your data requires UTF-8 or just plain ASCII characters it might be a wise choice to specify that via the initdb command:

initdb -D /var/lib/pgsql/data --encoding=UTF8 --locale=C
or
initdb -D /var/lib/pgsql/data --encoding=SQL_ASCII --locale=C

If you do not do this you need to be sure that you specify the correct encoding when you create the database instance for Chado via createdb.

Linux - PostgreSQL - Permiso denegado a la relación

Problema:

ERROR: permiso denegado a la relación [nombre_tabla]



Solución:

GRANT SELECT ON [nombre_tabla] TO PUBLIC;

o en vez de PUBLIC al usuario en postgres que requiera los privilegios de SELECT

.

Linux - PostgreSQL - Error SQL_ASCII

Problema:

#createdb -E SQL_ASCII -O [dueño] -U postgres [nombre_base]
createdb: falló la creación de la base de datos:
ERROR: la nueva codificación (SQL_ASCII) es incompatible con la codificación de la base de datos patrón (UTF8)


Solución 1:

A la hora de crear la base de datos usar la base templete0 como plantilla
#createdb -O [dueño] -E [SQL_ASCII] -T template0 [nombre_base_de_datos]


Solución 2:

Respaldar todas las bases, parar el servicio de postgresql y crear de nuevo el cluster con la codificación SQL_ASCII

#initdb -E SQL_ASCII -D /path/data --locale=C




.

julio 14, 2010

Webmaster - Herramientas - Vnc Client

Según Wikipedia. VNC son las siglas en inglés de Virtual Network Computing (Computación Virtual en Red ).

VNC es un software que permite controlar el escritorio de otra computadora muy parecido a la conexión del escritorio remoto de windows.

www.tightvnc.com


.

julio 01, 2010

Linux - PHP - phpMyAdmin - Extensión mcrypt

Error:
no se pudo cargar la extensión mcrypt,
por favor revise su configuración de PHP.

Solución:


# yum search mcrypt

# yum install php-mcrypt

# /etc/init.d/httpd restart



.

¿Cómo poner el conteo de las filas en una consulta en MySql?

 ¿Cómo poner el conteo de las filas en una consulta en MySql? SELECT  @rownum := @rownum + 1 AS contador,  /*Contador*/ t.*  /* nombre d...