How to fix the big guy called ‘ibdata1’

How to fix the big guy called ‘ibdata1’

Blog Databases Linux

The file ibdata1 is the system tablespace for InnoDB infrastructure, and it contains several informations about InnoDB such as table data pages, index pages, data dictionary, rollback segments, etc. This file is always growing, then, it’s easy to reach to giant sizes.

The size of this file commonly affects development and test machines, because many drops and imports with databases inflate this one. Then, to fix this problem, I have some steps to ends this problem.

Backup all your databases

Do a full dump of your databases.

Drop all your databases

Now, you’ll need remove all your databases, except for mysql and information_schema databases, because they are used by MySQL to control users and data information about managed databases.

Stop MySQL service

For the next step, you will need stop the MySQL service.

Configurations

Now, you’ll need change in MySQL how it’s manage InnoDB data, in this case using one file per table. Locate the my.cnf file on your server and putt this parameter at [mysqld] section:

Save with ‘Esc + :wq!’, then go to MySQL data folder:

The ls -alh command in this folder will print something like this:

Delete this file:

Finally, start MySQL service and import your databases again:

How to fix mysql.sock bug on CentOS 5.2

How to fix mysql.sock bug on CentOS 5.2

Blog Linux

Distros like CentOS keeps for a long time ~stable~ packages in him repositories. In most of time its great, but sometimes it’s sucks…this is my short story of one VM with CentOS 5.2 with all installed packages from your official repository.

I installed mysql-server 5.1.71 without customizations, the service its OK but, eventually service stopped running, wihtout logs, dmesg informations, etc. After many searches on Google, I finally found the root of all evil, a default configuration file ‘/etc/my.cnf’ was malformed, in this case the file doesn’t contains [client] section. I added this section like MySQL’s installation of Debian-based distros:

Put this content at end of configuration file:

After this, I just rebooted my VM to test initialization of all services, and, the MySQL.

Adding Desktop support to Gnome 3 based environments

Adding Desktop support to Gnome 3 based environments

Blog Linux

On Gnome 3 based environments or KDE, the Java Desktop support doesn’t work. How it is an older Java feature, you need to install an old package, from Gnome 2 environment:

Restart your environment service to apply this new package. The service name will varies according to distribution, such as:

Now, resources like Desktop.open(File file) will work.

Tip: recover your USB disks with live images inside

Tip: recover your USB disks with live images inside

Blog Linux

Sometimes we need to use a USB disk to record a linux image, and often we’ll this disc to other purposes, but we can’t because this disk stay in read-only mode, and even the root permissions cannot exclude these installation files from the disk. This occurs for me whenever I write Debian-based images. To fix this, we can use some simple command to ‘revive’ our USB disks :)

Unmounting your USB disk Continue reading

Tip: coping to multiple targets by prefix

Tip: coping to multiple targets by prefix

Blog Linux

If you need to copy one folder to multiples targets using him relative name, you can use xargs for echo command:

This will return all your target folders:

Now, combine the xargs output as parameter for /bin/cp command, specifying the source of copy:

Now, all your targets will have the same files.

References

http://manpages.ubuntu.com/manpages/precise/man1/xargs.1.html

http://manpages.ubuntu.com/manpages/hardy/en/man1/cp.1posix.html

Setup a Jetty 7 service for Debians or CentOS

Setup a Jetty 7 service for Debians or CentOS

Blog Linux

Recently I changed Apache Tomcat 7.x by Jetty 7.6.11 to test and production VMs. Incredibly, the start-up time passed of 8 minutes to  +- 2.5 minutes, the same for memory usage during this process.

Both servers has the same behavior for my applications, however, the slow start-up time of Apache Tomcat 7.x complicates my life and all of clients :/ …In the last few weeks, I’ve need release several builds…this in the rush hour. Continue reading

Restoring Grub after Windows installations

Restoring Grub after Windows installations

Blog Linux

If you, like me, installed a M$ Windows after Ubuntu installation, you’ll need to restore your Grub loader. To fix it you’ll need to do these simple steps:

Ubuntu-based Live CD/USB

Get your live CD/USB or, if necessary, download and create again, and boot your machine with this live CD/USB.

Mounting your / partition

Once in live CD/USB, open a terminal and mount your root ‘/’ partition, with you don’t remember or don’t know how do this, use GParted app  to list all your partitions, or then,  use ‘fdisk -l’ command to it. To mount partition use: Continue reading