Sei sulla pagina 1di 4

Name: Ngomonwing Clovis A. UB No: FE10A103 Course: CEF 304 Lecturer: Dr. Nguti D.

QUESTION: Download and Install MySQL in Windows and Linux, then Document.

Introduction MySQL is a relational database management system. It is a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL is an open source software. It is provided by MySQL AB, a Swedish company. These guides cover the download and installation of MySQL on Windows 7, 64bits and Linux Mint 10, 32bits. Windows 7 Installation of MySQL Downloaded from: http://www.mysql.com/downloads/mysql Run the MySQL installer. Click Next. Choose "Custom". Click Next. Change the install folder location to c:\mysql. Click OK. Click Next. Click Install. Click Next. Click Next. Leave the "Configure the MySQL Server now" box checked. Uncheck the "Register the MySQL Server now" box, if there is one. Click Finish. Click Next. Choose "Detailed Configuration". Click Next. Choose "Developer Machine". Click Next. Choose "Non-Transactional Database Only". Click Next. Choose "Manual Setting". Change level of concurrent connections to 100. Click Next. Check the box for "Enable TCP/IP Networking". Choose 3306 for the port number. Check the box next to "Add firewall exception for this port". Uncheck the box for "Enable Strict Mode". Click Next. Choose "Standard Character Set". Click Next. Check the box for "Install As Windows Service". The default service name is fine. Check the box for "Launch the MySQL Server automatically". Check the box for "Include Bin Directory in Windows PATH". Click Next.

Check the box for "Modify Security Settings". Type a password twice. Leave the other boxes unchecked. Click Next. Click Execute. Click Finish. Done! NB:

Uninstall any previous versions through the Control Panel prior to install. The download you need for Windows is the 'MSI Installer'. Disable the Windows Firewall temporary. Assign the server a static IP address. Log in as an Administrator.

Linux Mint Installation of MySQL The installation was done online with an internet connection and it is divided into multiple steps. 1. Installation of core packages Apache2, PHP and MySQL. 2. Testing if the web server is up and running. 3. Testing if PHP is working. 4. Installation of PhpMyAdmin. 5. Testing MySQL (via PhpMyAdmin). 6. Setting MySQL daemon to automatically start at boot. Installing Apache Open Terminal (Application > Accessories > Terminal) Copy-paste (or type) the following code into Terminal, then press enter: sudo apt-get install apache2 Terminal will then ask for your password type it, then press enter Testing Apache To make sure everything installed correctly, we will now test Apache to ensure it works properly. Open any web browser and then enter the following into the web address: http://localhost/ You should see a folder entitled apache2-default/. Open it and you will see a message saying It works Installing PHP In this part, we will install PHP 5. Again, open Terminal

Copy-paste or type the following line into Terminal, then press enter: sudo apt-get install php5 libapache2-mod-php5 In order for PHP to work and be compatible with Apache, we must restart Apache. Type the following code in Terminal to do this: sudo /etc/init.d/apache2 restart Testing PHP To make sure there are no issues with PHP, lets give it a quick test run In Terminal, use the command: sudo gedit /var/www/testphp.php This will open a file called testphp.php Copy-paste this line into the phptest files: <?php phpinfo(); ?> Save and close the file. Now open your web browser and type the following into the web address: http://localhost/testphp.php It will show you the page that has all information about your php. If you have prior experience of installing php in some other OS, you must have seen this page. Congrates! You have successfully installed both Apache and PHP! Installing MySQL Open Terminal, copy-paste the line: sudo apt-get install mysql-server (Optional). In order for other computers on your network to view the server you have just created, you must first edit the Bind Address. Begin by opening Terminal to edit the my.cnf file: gksudo gedit /etc/mysql/my.cnf Change the line: bind-address = 127.0.0.1, and change the 127.0.0.1 to your IP address. This is where things may start to get tricky. Begin by typing the following into Terminal: mysql -u root Following that, copy-paste this line: mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

(Make sure to change yourpassword to a password of your choice) We are now going to install a programme called phpMyAdmin, which is an easy tool to edit your database. Copy-paste the following line into Terminal: sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin After this is installed, our main task is to get PHP to work with MySQL. To do this, we will need to open a file entitled php.ini. To open it, type the following: gksudo gedit /etc/php5/apache2/php.ini Now we are going to have to uncomment the following line by taking out the semicolon (;) Change this line: ;extension=mysql.so to look like this: extension=mysql.so Now just restart Apache and you are all set! sudo /etc/init.d/apache2 restart If you get a 404 error upon visiting http://localhost/phpmyadmin: you will need to configure apache2.conf to work with phpmyadmin: sudo gedit /etc/apache2/apache2.conf Include the following line at the bottom of the file, save and quit: Include /etc/phpmyadmin/apache.conf Then just restart Apache: sudo /etc/init.d/apache2 restart Done !!! Setting MySQL daemon to start automatically Open Startup Programs (Menu > Preferences > Startup Applications >Startup Programs). Check the MySQL daemon in the list. Click ok. Done!

Potrebbero piacerti anche