Search This Blog

Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Sunday, November 17, 2013

Out put a result of a MySQL query into a CSV file

Out put a result of a MySQL query into a CSV file

SELECT  * FROM m_table INTO OUTFILE '/tmp/orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

Friday, July 8, 2011

Monday, May 2, 2011

Installing Apache, PHP, MySQL on Ubuntu


Install Apache 

Open Terminal (Application -> Accessories -> Terminal) and execute the following command:
sudo apt-get install apache2

check if the Apache is working properly by pointing your browser to http://localhost. If you see the text “It works!”, it means Apache is working.

Issue the following command to resolve following error “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName“

sudo  gedit /etc/apache2/conf.d/fqdn

When Gedit opens, type “ServerName localhost” inside the file and click Save

Install PHP



Inside Terminal, execute the following command:
sudo apt-get install php5 libapache2-mod-php5

execute this to restart apache

Execute the following command in Terminal:
    sudo /etc/init.d/apache2 restart

Install MySql

sudo apt-get install mysql-server



Inside Terminal, execute the following command:
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

Give the root password to complete the installation


Monday, February 7, 2011

How to Export and Import MySQL Db dump from command line

Go to the command line as root or admin user


Export the database

mysql -u UserName -p password databaseName > dbdump.sql


Import the database

mysql -u UserName -p password databaseName < dbdump.sql

Sunday, October 24, 2010

How to change MySQL admin password

mysqladmin -u root -p 'oldpassword' password newpass

MySQL case sensitivity of table names

When you transport databases from Linux to windows you may encounter errors due to table names being in uppercase . This happens because windows is case sensitive. You can override this problem by adding this parameter to your my.ini file.

lower_case_table_names=0


more on mysql site