Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Sunday, March 24, 2019

Tech Notes:-Extracting specific tables from MySQL dump

I encountered a situation where I had to extract only a specific table from a huge  MySQL dump. Here is how you could accomplish this.

Lets say the name of the table is mytable and the file containing the huge mysql dump is mysql.dump. Here is the command to extract mytable


This will copy into the file mytable.dump what is located between CREATE TABLE mytable and the next CREATE TABLE corresponding to the next table.

If required you can then adjust the file mytable.dump which contains the structure of the table mytable, and the data.

Wednesday, December 26, 2018

Tech Notes:- log file at /var/log/ansible.log is not writeable and we cannot create it, aborting

This is one of the errors that we encounter after installing ansible and trying to run our first playbook as a non-root user. To fix this all that we need to do is to create a group called ansible , add the user who is executing the playbook to the ansible group, then touch the file /var/log/asnible.log with root as the owner and ansible as the group.Permission should be 775 which is read write and execute for  owner and group and read and execute for others.

# sudo touch /var/log/ansible.log

#sudo groupadd ansible

# sudo chown root:ansible /var/log/ansible.log

# sudo chmod 775 /var/log/ansible.log

# sudo usermod sudeep -aG ansible

You need to signout and sign in before executing the playbook.


Related Posts Plugin for WordPress, Blogger...