Articles in the ‘Linux’ Category

How to configure UTF8 default collation in MySQL?

Wednesday, July 14th, 2010

How to configure MySQL to use UTF8 (UTF8_general_ci) as default collation in MySQL for the new databases?

Step 1:
Add in in /etc/my.cnf the following lines:


[mysql]
default-character-set=utf8
[mysqld]
collation_server=utf8_unicode_ci
character_set_server=utf8
default-character-set=utf8
init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'

Step 2: Restart MySQL
/etc/init.d/mysql restart

Problem emerge glibc-2.11

Thursday, July 1st, 2010

When try to emerge glibc-2.11 from older version you might get this error:

checking for cpuid.h... no
configure: error: gcc must provide the header
* ERROR: sys-libs/glibc-2.11.2 failed:
* failed to configure glibc

To solve it get the cpuid.h file from official GCC respositories and put it into /usr/include. Check the name of the downloaded file to be “cpuid.h”.

Now, glibc should compile without problem.

Backing Up All MySQL Databases

Monday, January 18th, 2010

To backup all the databases in MySQL use:

mysqldump --all-databases -pPASSWORD | bzip2 -c > databasebackup.sql.bz2

The password is for the user Root.

To restore MySQL use:

mysql -pPASSWORD < databasebackup.sql

How To Set SVN_EDITOR Environment Variable

Wednesday, January 6th, 2010

If you get the following error messages:

svn: Commit failed (details follow):
svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options

svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time configuration option was found

use the following command in the shell:

export SVN_EDITOR=nano

Update/Emerge in Gentoo

Tuesday, January 5th, 2010

best comands to use to emerge/update world are:
emerge --sync

and then

emerge -uDvNt world

these will update all the packs and applications in the server.

Scan with clam scan

Tuesday, January 5th, 2010

To scan with Clam scan, use

<code>clamscan -r –remove –quiet</code>

to update clam, use

<code>freshclam</code>