Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

2011-04-22

Mysql - Error about packet too big while importing sql database












Q : While importing database in mysql, an error message pops out "ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes"
E.g.
$ mysql5 -u db_user -p db_table < db_table.sql 
Enter password: 
ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes
A : The file importing contains a statement that's probably too big, increase the value "max_allowed_packet" in my.cnf:

2011-02-04

ssh - How to pipe output from local to remote server

In Bash, with pipe (the "|" symbol) and ssh makes a good combination of server administration tool, securely. Some examples :

2011-01-07

Bash - How to check the exit status of pipe command


Piping in bash commands are common.
Checking exit status of a command in bash scripting is essential.
How about checking exit status of the commands in a pipe?





Example:

2009-09-14

Perl - How to install Perl module using CPAN shell

One of Perl's strength is it's repository of modules, thousands of modules. No need to re-invent the wheel, just think of what you wanna do and search for it (http://cpan.perl.org).

The CPAN modules are available through the CPAN shell. In this post, we will talk briefly about how to install the CPAN shell and show an example of installing a module.

2009-08-20

MySQL - Passwordless login within bash script

As like the previous post about passwordless login within Bash script, this post is about how to connect to MySQL database server using Bash script without MySQL client prompting for login.

Here it is :

2009-05-20

MySQL - Common commands of database user account management

SQL database are used to store various kind of data in order for future retrieval. But data stored in SQL database is not only for future retrieval, it is also stored in such a way for faster (repeated) retrieval, structured manner in data organization, interchangeable between applications and most importantly, it provides a mean to store and search for really huge data by using SQL statement, query.

There are a lot of database currently available, e.g. PostgreSQL & MySQL. MySQL is one of the most popular database among open source database, same as PostgreSQL. Due to the hip of LAMP (which denotes Linux, Apache, MySQL, PHP), MySQL have made known to the mass audience. No doubts its performance and usability are, both MySQL & PostgreSQL, in par.

This post will not attempt to compare both excellent databases, rather, it will try to list out a few common uses of MySQL database in tips & shortcut way. Below are the list of common usage of MySQL permission and privileges :

2009-04-21

mysql server - how to reduce disk space by moving mysql-bin.00000

One fine day, the server disk usage report that, the one of the partitions is almost full. After some searching, the database directory at /var/db/mysql/ (FreeBSD) or /var/lib/mysql/ (Linux) is occupying most disk space. Listing the directory only to found out that mysql-bin.0000* are the ones that is occupying the disk space. What are these files? Can it be remove it to reduce disk usage?

These mysql-bin.0000* files are the binary logs for your database. It contains all the statements of updating your database. It another words, it is the archived of your database. Removing it will need some preparations, which is not covered in this post. But the below does suggest a way to move it to another partition or disk :