Showing posts with label :: Database. Show all posts
Showing posts with label :: Database. Show all posts

Thursday, November 20, 2014

MySQL delete all rows of tables back to zero id

To delete all rows in the table following these codes:
TRUNCATE first_table;
TRUNCATE second_table;
TRUNCATE third_table;
TRUNCATE fourth_table;

Friday, November 14, 2014

ERROR 1153 (08S01) at line 75: Got a packet bigger than 'max_allowed_packet' bytes

These error message raise when i run the script like the below:
mysql -u root -p my_database < dump.sql
Then raised:
ERROR 1153 (08S01) at line 75: Got a packet bigger than 'max_allowed_packet' bytes
Googling and found:
vi /etc/my.cnf
add these line under [mysqld]
[mysqld]
# added to avoid err "Got a packet bigger than 'max_allowed_packet' bytes"
#
net_buffer_length=1000000 
max_allowed_packet=1000000000
#
Restart the mysql db:
service mysqld restart
Finally, i import the database with successfully:
mysql -u root -p my_database < dump.sql

Thursday, January 16, 2014

Library not loaded: libmysqlclient.18.dylib (LoadError) on Mac OS

When installed raisl 4.0.1, it's raise some error:
/opt/local/lib/ruby2.0/gems/2.0.0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require': dlopen(/opt/local/lib/ruby2.0/gems/2.0.0/extensions/x86_64-darwin-13/2.0.0/mysql2-0.3.14/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /opt/local/lib/ruby2.0/gems/2.0.0/extensions/x86_64-darwin-13/2.0.0/mysql2-0.3.14/mysql2/mysql2.bundle
  Reason: no suitable image found.  Did find
to fix this problem, type command below:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

Installing MySQL on Mac OS X

Before you are download, ensure your architecture of Mac:
Oper your terminal and type
uname -a
and the result are:
Darwin aruls-mbp 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
The "RELEASE_X86_64 x86_64", it's mean your computer is using 64 Bit architecture computer.

Firstly, download the MySQL 64 Bit software





Double click at file "mysql-5.6.15-osx10.7-x86_64.dmg" and will appear popup like this:













Ok, next step is:

Install the mysql-5.6.15-osx10.7-x86_64.dmg
Install the MySQLStartupItem.pkg
Install the MySQL.prefpane

















Then click "Start MySQL Server" and "Check Automatically Start on startup"
We need do something to using "mysql" command work on the Terminal, follow the step
Open up your terminal:
vi ~/.profile
Use the "i" key, to insert mode, then paste this line:
"export PATH=$PATH:/usr/local/mysql/bin"


















Hit the ‘Esc’ key to exit insert mode and type “:wq” and hit enter to write and quit the editor. Close the terminal window and open a new one. You can then enter this command:
mysql -u root -p
Set MySQL password
/usr/local/mysql/bin/mysqladmin -u root password SECRET
Setting the Socket The last command we'll need to run in terminal will allow Apache and PHP to access MySQL:
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Wednesday, April 24, 2013

Design and manage your database with GUI application

Hi Guys,
you wanna to design, create, view..etc database, everything you can do with GUI database application
here the some applications you can try:

MySQL Workbench
 Download













Navicat
 Download
















Valentina
 Download