Mysql crash problems on EC2 AWS micro instance

If you have the default mysql config probably you’ll have some crash problems after a while running the instance.

I’m running a micro instance, with Ubuntu 12.04 and default mysql installation.

I’ve this logs reports:

[Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.7
InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
InnoDB: Completed initialization of buffer pool
InnoDB: Fatal error: cannot allocate memory for the buffer pool
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

[Note] /usr/sbin/mysqld: Shutdown complete

 

To solve it you need to add some lines on the /etc/mysql/my.cnf file after the [mysql] line:

innodb_buffer_pool_size = 40M
key_buffer_size=10M
max_connections=5

Also it’s recommended to run a repair table on each of your databases after changing the mysql settings and restart the mysqld service.

Git keep asking for my username and password on GitHub

If you’re experiencing this problem maybe you’ve made the checkout with the http or https url, that means that you dont have an authentication method.

For linux or Mac you can solve it with a simple way.

Mac:

    git config --global credential.helper osxkeychain

Linux:

    git config credential.helper cache

Reference for cache options on this link http://git-scm.com/docs/git-credential-cache

If you’re on windows and you’re trying to use cache the cache helper you might have the next message:

    git: 'credential-cache' is not a git command. See 'git --help'.

So in that case you need to setup the ssh connection and change your remote protocol connection from http to ssh. To do that you need run:

    git remote set-url origin git@github.com:username/repo-url-on-github.git

You also need to setup your ssl-key you can do it from the GitHub config https://github.com/settings/ssh . If you don’t know how to generate ssh keys just follow these steps https://help.github.com/articles/generating-ssh-keys .