Php Nodes Full

  • View
    216

  • Download
    0

Embed Size (px)

Text of Php Nodes Full

  • 8/8/2019 Php Nodes Full

    1/109

    gani.tanuku@gmail.com MySql, Php, Apache

    Unit-I: Installing and configuring MYSQL, Apache and PHP

    Chapter-1. Installing and configuring MYSQL

    Current and future versions of MYSQL:

    MySQL 5.5 is the current development release series. MySQL 5.1 is the current General Availability (Production) release series. MySQL 5.0 is the production release series. The MySQL is open source and the versions are availabl e on website is

    http://www.mysql.com/downloads . MYSQL AB, now owned by the sun micro systems, it is responsible for creating and

    distributing mysql.

    The MySQL distribution consist of three numbers and a suffix; for example, mysql-5.0.14-rc .

    The first number ( 5) is the major version and describes the file format. All MySQL 5releases have the same file format. The second number ( 0) is the release level. the major version and release level combines

    the release series number. The third number ( 14 ) is the version number or minor number within the release series.

    This is incremented for each new release.

    For each minor update, the last number is increased. When there are major new features with previous versions, the second number is incremented. When the file format changes, the firstnumber is increased.

    Release names also include a suffix. The possible suffixes are: alpha indicates that the release is for preview purposes only beta indicates that the release is appropriate for use with new development. rc indicates a Release Candidate. Release candidates are having all of MySQL's internal

    testing. If there is no suffix, it indicates that is the release is a General Availability (GA) or

    Production release.

    How to get mysql s/w: MYSQL AB company develops and maintains the mysql database server on website is http://www.mysql.com/downloads or http://dev.mysql.com .in this websites there are

    containing number of o/s platform distributions. Select the one distribution file in specific os. Youwill install the mysql on linux then you will choose to rpm extension or .tar.gz extension or youwill install on windows choose win32 binary distribution.

    S.G.S Degree College, pippara T.Ganesh M.C.A

    1

    http://www.mysql.com/downloadshttp://www.mysql.com/downloadshttp://www.mysql.com/downloadshttp://www.mysql.com/downloads
  • 8/8/2019 Php Nodes Full

    2/109

    gani.tanuku@gmail.com MySql, Php, Apache

    Mysql installation on LINUX:

    Process of Installing mysql on linux you use two ways i.e RPM or Binaries

    RPM installation it is fast and simple installation The only drawback here is thatMySQL is not installed into a single destination it's install the several directories.

    Installing binaries downloading installation files from the mysql.com website, copyingthem into a directory of your choice, and doing some simple configuration.

    Using RPM Installation of mysql:

    Using RPM , it has contain two files:

    MySql- server-type -VERSIONNUMBER .PLATFORM .rpm----it is my sql s erver MySql- client-type -VERSIONNUMBER .PLATFORM .rpm----it is my sql client libraries.

    To perform a minimal installation from RPMs, you can type the following at your Linux prompt

    i.e

    Shell>rpm i MySQL server-5.0.51.i386.rpm MySQL client 5.0.51.i386.rpm

    Now mysq linstallation will be started on linux..

    Using Binaries Installation of mysql:

    Another installation method is to install MySQL from binary. This method requires gunzip and tar files (files with .tar.gz extension) and also requires to create groups and users on the system.

    1. If your system does not contain a user and group for mysql then u will create user andgroups as follows

    shell> groupadd mysql

    shell> useradd -g mysql mysql

    The above will create a user that has login permissions to your server.These commands addthe mysql group and the mysql user.

    2. Pick the directory under which you want to intsallation files and change location into itshell> cd /usr/local

    3. Unpack the distribution, which creates the installation directory. Then create a symbolic link tothat directory:

    shell> gunzip < /path/to/mysql-VERSION-OS .tar.gz | tar xvf -

    shell> ln -s full-path-to-mysql-VERSION-OS mysql

    shell> tar zxvf /path/to/mysql-VERSION-OS .tar.gz

    S.G.S Degree College, pippara T.Ganesh M.C.A

    2

  • 8/8/2019 Php Nodes Full

    3/109

    gani.tanuku@gmail.com MySql, Php, Apache

    4. Change location into the installation directory:

    shell> cd mysql

    You will find several files and subdirectories in the mysql directory i.e for installation purposesare the bin and scripts subdirectories:

    The bin directory contains client programs and the server.The scripts directory contains the mysql_install_db script. It is used to initializethe mysql database

    mysql installation files are contains as root so change the owenership to mysql by usingfollowing commands.

    shell> chown -R mysql .

    shell> chgrp -R mysql .

    The first command changes the owner attribute of the files to the mysql user. The secondchanges the group attribute to the mysql group.

    If you have not installed MySQL before, you must create the MySQL data directory andinitialize the grant tables:

    shell> scripts/mysql_install_db --user=mysql

    this command runs as root , so change ownerships to root because data directory and itcontents with mysql as the owner.

    After creating or updating the grant tables, you need to restart the server manually.

    7. Most of the MySQL installation can be owned by root .this, run the following commands asroot in the installation directory:

    shell> chown -R root .

    shell> chown -R mysql data

    8. After everything has been unpacked and installed, To start the MySQL server, use thefollowing command:

    shell> bin/mysqld_safe --user=mysql &

    After starting the server, you should set up passwords.

    set the root password

    Now, before you do anything else, set root user's password (!)

    SELECT Host, User FROM mysql.user;SET PASSWORD FOR 'root'@'localhost' = PASSWORD(' new_password ');

    S.G.S Degree College, pippara T.Ganesh M.C.A

    3

  • 8/8/2019 Php Nodes Full

    4/109

    gani.tanuku@gmail.com MySql, Php, Apache

    MYSQL installation on windows :

    1. If you installed mysql software on windows then you can download the MySQLServer(win32 installer) software from the MySQL website . after download it stores the fileon your Windows Desktop.

    2. now double click the setup.exe file. It will be display the mysql setup wizard as shown in

    below figure. In this window select the next tab.

    3. after clcik next it will display the setup type window. It provides 3 setup type options i.etypical, custom, complete. Now here Choose the custom type option and click the nextshown in below fig.

    4. next it displays custom setup window. Here change the all features are installed andchange the installation directory i.e c:\server\mysql\ and click the next tab.(shown in

    below fig)

    S.G.S Degree College, pippara T.Ganesh M.C.A

    4

    http://dev.mysql.com/downloads/mysql/4.1.htmlhttp://dev.mysql.com/downloads/mysql/4.1.htmlhttp://dev.mysql.com/downloads/mysql/4.1.html
  • 8/8/2019 Php Nodes Full

    5/109

    gani.tanuku@gmail.com MySql, Php, Apache

    5. after clcik the next tab the wizard ready to began installation when e ver click the install tab.(as shown in below fig)

    6. click the install tab now it installs the files of mysql server in proper location.

    7. When the installation is complete it display the wizard complete window. In this windowselect the configure option and click the finish tab.

    S.G.S Degree College, pippara T.Ganesh M.C.A

    5

  • 8/8/2019 Php Nodes Full

    6/109

    gani.tanuku@gmail.com MySql, Php, Apache

    8. when ever click the finish tab it displays the configuration window welcome screen, click the next.(as shown in below fig)

    9. now go to the next wizard. you will see two options for s erver configuration i.e detailedconfiguration, standard configuration options. You can select the detailed configuration

    option and click the next as shown in below fig

    10. display the next wizard, in this wizard set the windows options i.e select the intsall aswindows service and give the service name i.e mysql in service name textbox and select theinclude bin directory in windows path option , click the next.(as shown in below fig.)

    S.G.S Degree College, pippara T.Ganesh M.C.A

    6

  • 8/8/2019 Php Nodes Full

    7/109

    gani.tanuku@gmail.com MySql, Php, Apache

    11. next wizard is displayed. Here set the security settings i.e type the new root password andtype the confirm password, click next as shown in below fig.

    12. now ready to execute all settings to the configuration whe n ever u click the execute button.select the execute button, now create the configuration file and start the mysql service.

    Click finish tab to close the wizard.

    Introducing the mysql privilage system:The mysql privilage system is always on. You can try to connect the mysql server it checks thefollowing three things i.e

    check the host(where you access from)Username and passwordCommand privileges

    All this information is stored in database it is automatically created when mysql is installed.

    There are number of privileges in mysql database i.eColumns privileges: defines user privileges for particular fields in a tableDb privileges: defines the permissions for all databases on a server Host privileges: defines the valid hosts that is used to connect the dat