MySQL5.6 installation steps (windows7/8_64 bit)

1. Unzip the MySQL archive

Unzip the downloaded MySQL zip file to a custom directory.

2. Add environment variables

Variable name: MYSQL_HOME

Variable value: D:\Program Files\mysql-5.6.11-winx64

That is, the custom decompression directory of mysql.

Then add %MYSQL_HOME%\bin to Path

3. Register Windows system service

Register mysql as a windows system service

The operation is as follows:

1) Go to the bin directory under the MySQL decompression directory from the console:

2) Enter the service installation command:

mysqld install MySQL --defaults-file="D:\Program Files\mysql-5.6.11-winx64\my-default.ini"

After the installation is successful, you will be prompted that the service installation was successful.

Note: the my-default.ini file is in the root directory of MySQL after decompression, if not, it can be obtained from other places.

The command to remove the service is: mysqld remove

4. Start the MySQL service

method one:

The command to start the service is: net start mysql

Method Two:

Open Administrative Tools Services and find the MySQL service.

Start the service by right-clicking and selecting Start or by clicking Start on the left.

 5. Change the password of the root account

When the installation is completed, the default password of the root account is empty. You can change the password to the specified password at this time. Such as: 123456

method one:

c:>mysql –uroot

mysql>show databases;

mysql>use mysql;

mysql>UPDATE user SETpassword=PASSWORD("123456") WHERE user='root';

mysql>FLUSH PRIVILEGES;

mysql>QUIT

Method Two:

Use third-party management tools to change passwords. Such as Navicat for MySQL

Method three:

mysql -u root has no password by default, then change the password

 

 Delete database command > mysqld --remove

删除后重新启动

 

其它资料收集

原因系统默认的mysql路径不正确
先删除原来的mysql服务
在cmd中输入sc delete MySql
之后添加系统环境变量path,加入你的mysql安装路径+bin
如c:\mysql\bin
然后在cmd中进入你的mysql安装目录的bin文件夹
输入mysqld -install
显示安装成功后就可以使用mysql连接了
如果要修改root密码可以在mysqld启动后输入
mysqldadmin -uroot -p原始密码 password新密码
注意:在mysqld -install完成服务安装后启动服务可能出现无法启动的问题 如果遇到请再次删除服务再安装

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326128971&siteId=291194637