当前位置:网站首页>Using CMD (command prompt) to install MySQL & configure the environment

Using CMD (command prompt) to install MySQL & configure the environment

2022-06-25 12:49:00 xiongᥫᩣ

Catalog

One , decompression

Two , Configure environment variables

  3、 ... and , edit path 

  Four , newly build my.ini

  5、 ... and , install

6、 ... and , initialization

  7、 ... and , start-up

  8、 ... and , Set the password

Nine , Connect


One , decompression

You can download it from the Internet mysql The compressed package of is used to install , After downloading the compressed package, the first step is to decompress .

Two , Configure environment variables

1. Find this computer on the desktop , Right click to select Properties

 2. After entering the setting , Slide down and click Advanced system settings

 3. After entering advanced system settings, click environment variables

 4. Click New , Add a system variable

 5. Variable names can be used directly  MYSQL_HOME The value of the variable is your mysql Folder storage location

  3、 ... and , edit path 

1. Find... In the system variable Path

 2. Double click in Path Click new to add an environment variable

  Four , newly build my.ini

1. Copy and paste the file into MySQL Go to the folder

 2. Right click Edit , Replace the default path inside with the one you saved MySQL Path to folder


The following operations need to be entered first bin Directory  

  5、 ... and , install

win+r Input cmd Go to the command prompt , Go back to bin Go to the catalogue

The following is the blogger's code :

C:\Users\Administrator>f:

F:\>cd mysql5.7

F:\mysql5.7>cd mysql-5.7.23-winx64

F:\mysql5.7\mysql-5.7.23-winx64>cd bin

F:\mysql5.7\mysql-5.7.23-winx64\bin>

  Then enter the following code to MySQL Installation

mysqld -install

6、 ... and , initialization

According to just my.ini File to initialize , Then it will produce a data Folder

mysqld --initialize-insecure --user=mysql    

 

  7、 ... and , start-up

stay cmd Enter the following code in , Use to start MySQL

 net start mysql

  Open the task manager and you can see that there are already MySQL The existence of  

  8、 ... and , Set the password

stay password Enter the new password later , And then click enter Go to the next step

 mysqladmin -u root -p password New password

Enter password: Old password     Directly enter , Because initialization directly puts mysql The password for is set to null , So the first old password is empty  

Nine , Connect

stay cmd Enter the following code in :

When it is found that the database can be displayed , It means that MySQL It has been installed successfully

Connect         mysql -uroot -p ;

Display database       show databases;

Display table           show tables;


That's all for today's knowledge sharing , Wonderful next issue continues ! If you have any questions, you can leave a message in the comment area or send a private message to the blogger

原网站

版权声明
本文为[xiongᥫᩣ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251214130073.html