How To Install MySQL
This task describes how to install a MySQL database for use with Java
1. Browse to the MySQL download site: http://dev.mysql.com/downloads
2. Locate and select the appropriate package for your platform.
MySQL 5.0.67 or higher.
3. If prompted, specify a location on your system in which to download and install MySQL.
4. Browse to where you downloaded MySQL, and double-click the installer file(Setup.exe).
The MySQL Server Setup wizard guides you through the MySQL installation, followed by the
5. At the Welcome window, click Next.
6. Select the Typical setup type, and click Next.
7. Click Install, and click Next -> Once again Next.
8. Skip the MySQL registration(not in all the versions).
9. In the Wizard Completed window, click Finish(Make sure that "Configure the MySQL server now" check box is selected .)
The MySQL Server Setup wizard closes, and the MySQL Server Instance Configuration wizard
The MySQL configuration wizard starts immediately after the MySQL
Server Setup wizard closes. This
section describes how to configure MySQL to work with Java Workspace Tutorials.
1. In the Welcome window, click Next.
2. Select Detailed Configuration(if you are not aware of any thing then choose Standard Configuration), and click Next(If you are a beginner you can select Standard Configuration this will set the default settings and this will take you directly to step 9 - You can even reconfigure once again).
3. Select Server Machine, and click Next.
For production use, choose Dedicated MySQL Server Machine. The option selected determines
the memory allocation.
4. For database use, select Transactional Database Only, and click Next.
This creates a database that uses InnoDB as its storage engine.
5. Accept the default drive and path for the InnoDB tablespace settings, and click Next.
6. To set the approximate number of concurrent connections to the server, select Decision Support
(DSS) OLAP, and click Next.(Optionally you can select Manual Setting and increase the Concurrent connections).
7. Accept the default networking options (Enable TCP/IP Networking, Port Number 3306), and the
default server SQL mode (Enable Strict Mode), and click Next.
8. Select Best Support for Multilingualism, and click Next.
This sets the default character set to be UTF-8.
9. (Windows) Select Install as Windows Service and Include Bin Directory in Windows PATH, and
10. Set the following security options:
a. Select Modify Security Settings.
b. Type the root password admin, and then retype the password.
11. Click Next.
12. Click Execute.
A message informs you the configuration is complete and MySQL is installed.
13. Click Finish.
(Note: Sometimes you may get error at Apply Security Settings or at Start Service and Apply Security Settings. (The security settings code could not be applied to the database because the connection has failed with the following error - some error no). This will happen only when you uninstall and reinstall MySQL. When you uninstall MySQL it won't delete data folder which is inside "C:\Program Files\MySQL\MySQL Server 5.1\data". So delete the entire folder MySQL from Program Files and try installing a fresh copy of MySQL once again then follow the steps which is mentioned in Configuring MySQL. (Some times you may not be able to delete MySQL folder which is inside "C:\Program Files". This is because MySQL might be running in the background. So to avoid that
- Go to Control Panel -> Administrative Tools -> Services (Short cut: start-> Run -> Type "services.msc") .
- Look of MySQL in the list and click that. Then stop the process by clicking Stop button and click ok
- In task manager (Ctrl+Alt+Del) look for mysqld.exe in Processes Tab. Then click End process. Now try deleting MySQL folder from Program Files.
MySQL is set up. Next, you can verify that MySQL is correctly installed.
Verifying the MySQL installation
Once you have installed MySQL, this task describes how to verify that it was installed correctly.
1. Open a command prompt.
2. At the prompt, enter mysql -u root -p.
3. Type the password that you set during the installation, and press ENTER.
Information about the installed MySQL version displays. If no errors are reported, MySQL is installed and running.
- At the mysql> prompt, type exit to exit MySQL.
- You can even test using Start->All Programs->MySQL->MySQL Server 5.1-> MySQL Command Line Client. Then type your password and check.
You have installed MySQL successfully.