Tuesday, October 7, 2014

Where does MySQL store data in PC


Windows

Find the my.ini file which store in the MySQL installation folder.
and then open the file and Find the “datadir”, this is the where does MySQL stored the data in Windows.
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"

Linux

Find the my.cnf with the sudo find / -name my.cnf command.
2) viewthe my.cnf file cat /etc/mysql/my.cnf
yongmo@myserver:~$ cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
[mysqld]
#
# * Basic Settings
#
user   = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket  = /var/run/mysqld/mysqld.sock
port   = 3306
basedir  = /usr
datadir  = /var/lib/mysql
tmpdir  = /tmp
language = /usr/share/mysql/english
skip-external-locking

3) Find the “datadir”, this is where does MySQL stored the data in Linux system. 

Saturday, January 19, 2013

Install a .sql file to a database in MySQL

First open the command prompt and go to the your MySQL installed directory and go to the bin folder in command prompt.Then copy your database file(.sql file) to that directory(C:\Program Files\MySQL\MySQL Server 5.5\bin).
Then in command prompt run this code.

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql --user=USER_NAME --password=PASSWORD DATABASE_NAME<FILE_NAME.sql


As a example let's think my MySQL user name is root and password is dilan and I want to install a file called queries.sql to the database named myTestDB. The code snippet  will be as following.

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql --user=root --password=dilan myTestDB<queries.sql

Saturday, December 15, 2012

Install maven in windows 7


Install maven in windows 7.

Actually Apache Maven is not need to install on windows.It can be downloaded as a .zip file and extract it as a local directory and configure it to windows.

  • To this task java development kit(JDK) should be installed in your windows PC.First check JDK is installed and JAVA_HOME variable is set in the windows environmental variables.



          Right-click on my computer and select properties.
         Then select Advance system settings.
              After that select  Environmental variables button from System properties window.

              Then make sure your JAVA_HOME variable set to the JDK folder.If not set it to the JDK folder.


  • Then download Apache Maven and extract it.

                    Download Apache Maven from the http://maven.apache.org/download.html. Select a version and click on it. Then Extract it to some where in your PC. I have renamed the folder as maven.


  • Add MAVEN_HOME 

    Add MAVEN_HOME to the environmental variables,set it to your maven root folder. 



  • Update PATH

   update your PATH variable in the environmental variables with maven bin folder. After this you can use maven command any where in your file system. 

then click OK on all the widows and you are done...:-)


  • Check

    To check you install maven successfully type mvn -version on your command line.
If you see this kind of message congratulation you have successfully installed maven... :-)