w3resource

MySQL installation on Linux and Windows

installation on Linux and Windows

In this section we are going to discuss how to install MySQL on windows and Linux machines.

Download MySQL

You can download MySQL from http://dev.MySQL.com/downloads/.

Install MySQL on Linux (RedHat and its variants)

1. After downloading the required RPM package, you have to run the appropriate package with root privilege.

Syntax:

 rpm -i PackageName.rpm 

With the similar syntax, you can install MySQL client, workbench or any other software downloaded and required.

Install MySQL on Linux (Ubuntu and Debian)

Syntax for installing MySQL server

 apt-get install MySQL-server
 
 

Syntax for installing PHP module MySQL

sudo apt-get install php5-MySQL

Install MySQL on Windows

Download the binary distributions (MSI files) of MySQL server and other necessary MySQL tools from MySQL site.

Run MSI files on your Windows Machines. Make sure that you have privilege for installing software applications. Follow the instructions.

After the installation is completed, if you want to make PHP work with MySQL, make sure you complete the following steps -

1. Open php.ini file. Find and uncomment the following lines -
extension=php_MySQL.dll
extension=php_MySQLi.dll.

2. Create a php file on the root of your Apache or any other web server you are using. Write echo phpinfo(); in that php file. Run that PHP file form your browser (http://localhost/info.php, if your php file name is info.php). You should be able to see the following output if you have configured PHP and MySQL properly.

MySQL installation on windows

Note: phpinfo() displays a long list of information about PHP installation. We have shown the MySQL part only.

Previous: MySQL Home
Next: MySQL Workbench



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/mysql/mysql-installation-on-linux-and-windows.php