mysql server installation

Work required that he be installed on a computer MYsql, I'm a bit wind10,64, computer configuration should be enough. . .

The first step to find a installation package
I am looking for mysql-5.7.21-winx64
as Lei Feng, to learn to sacrifice:
https://pan.baidu.com/s/1m5DbvS9KZ9rugKU8U8TJTA extraction code: kvhy

The second step configuration environment
My Computer -> Properties -> Advanced System Settings -> Environment Variables ----> System Variables ----> path
mysql server installation
blue area, fill in your own file address;

The third step
This step is a sin; do not know why, here there is no original file, there may be missing it, but Data does not need to add their own, but needs its own building a my.ini. . .
mysql server installation
Look at my configuration, roughly as follows:
mysql server installation
blue area change your address like:

The fourth step start
to remember myself, the way to start using the Administrator cmd command prompt:
mysql server installation
then: Go to your folder bin execute mysqld --initialize-insecure --user = mysql initialization
mysql server installation
after a few moments without prompting, but not error message will appear:
then: mysqld install installation

再然后:
net start mysql
提示安装成功:结束
进入数据库 :初始状态是么有密码的:
直接;mysql –u root –p
mysql server installation
注;更改mysql登录密码
方法1: 用SET PASSWORD命令
首先登录MySQL。
格式:mysql> set password for 用户名@localhost = password(‘新密码’);
例子:mysql> set password for root@localhost = password(‘123’);

方法2:用mysqladmin
格式:mysqladmin -u用户名 -p旧密码 password 新密码
例子:mysqladmin -uroot -p123456 password 123

方法3:用UPDATE直接编辑user表 (我用的这种方法)
首先登录MySQL。

C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin>mysql -u root -p

mysql> use mysql;
mysql> update user set password=password(‘123’) where user=‘root’ and host=‘localhost’;
mysql> flush privileges;

方法4:在忘记root密码的时候,可以这样
以windows为例:

Close MySQL services are running.
Open a DOS window, go to the mysql \ bin directory.
Input mysqld --skip-grant-tables carriage. -Skip-grant-tables means that the time to start MySQL service permission to skip the authentication table.
And then open a DOS window (DOS window because that just can not move), go to the mysql \ bin directory.
Enter input mysql, if successful, will appear MySQL prompt>.
Connection permissions database: use mysql;.
Password change: update user set password = password ( "123") where user = "root"; ( Remember last semicolon).
Refresh permission (must step): flush privileges;.
Quit quit.
Log off the system, re-entry, using the username root and the password you just set up 123 new login.

Guess you like

Origin blog.51cto.com/14545985/2439039