Install mysql in 64-bit Windows 7 (practice successful !!!)

Source: Internet
Author: User
Tags root access
: Www. mysql. to download comdownloadsmysql, You need to log on. You only need to register an account as required, and then download it. I downloaded the version of mysql-5.5.17-winx64.msi. installation Procedure: Step1.MysqlServeruninstall: Check whether the system is installed. Indeed

: Http://www.mysql.com/downloads/mysql/ download needs to log on, you just need to register an account as required, and then download it. I downloaded the version of mysql-5.5.17-winx64.msi. installation Steps: Step 1. mysql Server uninstall determines that the system is not installed (check the programs and functions in the control panel. Indeed

:

Http://www.mysql.com/downloads/mysql/

You only need to register an account as required, and then download the account.

I downloaded the version of mysql-5.5.17-winx64.msi.

Installation steps:

Step 1. Mysql Server uninstall

Make sure the system is not installed (check the programs and functions in the control panel. Are you sure you have not installed mysql)

Step 2. Program Files Mysql Server directory delete (all files)

Delete all mysql files. Note that the C: \ ProgramData \ MySQL and C: \ ProgramFiles \ MySQL directories are deleted. You can also run the Registry-> Run-> regedit-> HKEY_LOCAL_MACHINE, SYSTEM, CurrentControlSet, services, and delete the Mysql directory.

Step 3. New MySql Server Instalation. (or restart computer andinstall)

It is best to restart (we strongly recommend that you restart to avoid unnecessary troubles ),

Double-click the mysql-5.5.17-winx64.msi for a new installation.

Step 4. Exit instance configration wizard.

Install the main program. Do not enter the configuration.

Before finishing the last step, remove the check box on the panel. Remember!

Step 5. Mysql Server instance configuration wizart runAdministrator. (right click

Select menu)

Go to C: \ ProgramFiles \ MySQL Server 5.5 \ bin, right-click bin, and select Run MySQLInstanceConfig as the administrator.

Step 6. Installation select Add Port Firewall

Other configurations are similar to those in XP.

Step 7. Not selected "enable root access from remotemachines" (beacuse error config

Workbench)

Special attention !!! After you enter the password and confirm the password, the following check box cannot be checked.

Step 8 Finish Mysql ServerInstalation

Run the command again.

Test the connection to the database.

Choose Start> program and click MYSQL5.5 Command Line cilent.

Enter Password: root

To view the database commands that come with the mysql database

Show databases;

Create a new database: createdatabase database name;

Example: create database testdata;

The statement for creating a table is not described below.

You can also use a visual mysql tool, such as sqlYong or Navicat. To create a database.

So here, by the way, the use of NavicatPremium (which can connect to multiple databases such as mysql, oracle, and sqlserver:

First create a Connection,



Enter ConnectionName and Password, and click OK. See;



Create the database testdata and create a table user. The user table contains us_pk, us_name, us_pwd.

Add a record 1 1 1

Test the connection

Write a java class;

ImportJava. SQL. Connection;

ImportJava. SQL. DriverManager;

ImportJava. SQL. ResultSet;

ImportJava. SQL. Statement;

Public classTestMysqlConn {

Public static voidMain (String [] args ){

Connection con;

Statement stmt;

ResultSet rs;

Try{

Class.ForName("Com. mysql. jdbc. Driver"). newInstance ();

Con = DriverManager.GetConnection("Jdbc: mysql: // 127.0.0.1: 3306/testdata", "root", "root ");

Stmt = con. createStatement ();

Rs = stmt.exe cuteQuery ("select * fromuser ");

System.Out. Println (rs. next ());

}Catch(Exception e ){

E. printStackTrace ();

System.Out. Println ("connection failed ");

}

}

}

My problem is: the connection fails and the host cannot be connected.

Because 127.0.0.1 in jdbc: mysql: // 127.0.0.1: 3306/testdata cannot be connected as my computer IP192.168.5.6 is written as 127.0.0.1 or localhost.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.