Mysql Tricks : Show status information on a table

Show status information on a table. Note, if the database was started with --safe-show-database or --skip-show-database some of these commands may not work. Note the "\G" option may provide a nicer format. Show the create statement: mysql> show create table dupTest\G ... Read more..

May 17th, 2011 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Dump Content using mysqldump

You do not need to enter mysql for this , here is the exact sintax you must use : mysqldump -u [username] -p [database_name] > /path/to/file.sql  example mysqldump -u mario  -p marioDB > /tmp/marioDB.sql Read more..

May 2nd, 2011 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Recovering / Changing Your MySQL Root Password

Recovering / Changing Your MySQL Root Password Sometimes you may have to recover the MySQL root password because it was either forgotten or misplaced. The steps you need are: 1) Stop MySQL [root@bigboy tmp]# service mysqld stop Stopping MySQL:  [  OK  ] [root@bigboy tmp]# 2) Start MySQL in Safe mode with the mysqld_safe command and tell it not to read the grant tables with all the MySQL database passwords. [root@bigboy tmp]# mysqld_safe --skip-grant-tables --skip-networking & [1] 13007 [root@bigboy tmp]# Starting mysqld daemon with databases from /var/lib/mysql [root@bigboy tmp]# Note: In Fedora ... Read more..

April 6th, 2011 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Installation: configured for encryption, C API, and user defined functions.

Installation: configured for encryption, C API, and user defined functions. ./configure --with-openssl --enable-thread-safe-client --with-mysqld-ldflags=-rdynamic The --with-openssl is very helpful for creating your own password file. Also, if doing C API, having thread safe calls "could" come in handly...it's what I use. See (TIP 27) for user defined functions. Complete ... Read more..

January 14th, 2011 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Use CONCAT to include text in SELECT results in MySQL

Function CONCAT allows the SELECT statements to act like printf commands by ataching text results to query results and so on Example : Generate a list of links in HTML from a table 'mylinks' with the columns 'urls' (http://www.ossmall.info) with 'title' (Open Software Solutions) The output will look like this : <a href="http://www.ossmall.info">Open Software Solutions</a><br /> To do this you must use a select statement like: SELECT CONCAT('<a href="', urls, '">', title, '</a><br />') FROM mylinks; Read more..

October 3rd, 2010 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Create a MySQL database

Log in MySql To create a database called 'yourdatabase' use the following SQL command: create database yourdatabase; Read more..

September 9th, 2010 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Add a column to an existing MySQL table

We will  add a column called email to the mycontacts table created in Create a basic MySQL table with a datatype of VARCHAR(90) To do this use the following SQL statements: 1.  this statement will add the column at the bottom of the table  ALTER TABLE mycontacts ADD email VARCHAR(90); 2.  this statement will add the column after a specific column ( such as name ) ALTER TABLE mycontacts ADD email VARCHAR(90) AFTER name; 3. this statement will add the column at the begining of ... Read more..

August 8th, 2010 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Create a MySQL user account

This is how to create a user youruser with password YourPassword  and grant them full access to the  database named yourdatabase, connect to the database with mysql and issue the command: grant all on yourdatabase.* to user@localhost identified by 'YourPassword'; Read more..

June 29th, 2010 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Change the MySQL root user password

To change the MySQL root password to DifferentPass , use: mysqladmin -u root password DifferentPass Keep in mind , root is a powerfull user in mysql , use Hard Passwords ! Read more..

June 17th, 2010 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button

Mysql Tricks : Monitor port 3306

Monitor port 3306: tcpdump -i eth0 -nN -vvv -xX -s 1500 port 3306 and host not 192.168.1.102 The -s is length of each packet. This monitors all traffic on port 3306 excluding the good client 192.168.1.102. The out will be in the following format: [root@third-fl-71 root]# tcpdump -i eth0 -nN -vvv -xX -s 1500 port ... Read more..

May 7th, 2009 admin Posted in MySQL No Comments »

AddThis Social Bookmark Button


Page 2 of 212