当前位置:网站首页>MySQL development environment

MySQL development environment

2022-06-27 03:33:00 Luoluo hushengwei

hello, Family , Today I will teach you how to use the command prompt to install MySql, ha-ha , Follow my steps step by step , It's easy , come on. !

 

Catalog

One . install mysql5.7.23 Decompression version

2. Configure environment variables :

3. edit path    

4. newly build my.ini  

5. install

6. initialization  

7. start-up        

8. Set the password    

9.Enter password: Old password  

10. Connect          

11. test

Two 、 uninstall mysql

1 Out of Service      

2. Delete service    

3. Remove the service    

4. Delete registry information

5. Delete mysql Installation directory

3、 ... and : solve mysql Unable to connect remotely :


One . install mysql5.7.23 Decompression version

1. First download it on the official website , Then we will get a compressed package , Then we need to decompress all the compressed packages , Then it will be like this

 

Because my folder here is installed in E Discoid , So just take me as an example .

2. Configure environment variables :

 MYSQL_HOME E:\MySql\mysql-5.7.23-winx64

  Turn on the settings first

 

 

Then turn on the system

 

Then click Advanced system settings on the right

 

You will enter the above interface , Then click Advanced , Select the environment variables option below

 

notes : It is best to configure environment variables in system variables

3. edit path    

  %MYSQL_HOME%\bin

4. newly build my.ini  

newly build my.ini  , Put it in MySql Under the folder


[mysqld]
port = 3306
basedir=E:\MySql\mysql-5.7.23-winx64
datadir=E:\MySql\mysql-5.7.23-winx64/data ( If there is... In the file directory data file , Delete before that )
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
default-character-set=utf8

 

explain :
sql_mode
NO_ENGINE_SUBSTITUTION:mysql stay create table You can specify engine Clause
STRICT_TRANS_TABLES: For a single insert operation , Whether inserting a single row or multiple rows , As long as the inserted data is incompatible with the field type , be insert Operation failed and rolled back
And mysql The closest thing is mariadb

Then we try to prevent installation errors , Use the registration edit table in our system , Then go to press Export , Then we will generate a suffix named .reg The file of , If then MySql Accidentally installed it askew , Or failed to install , You can delete this directory , You can save the useful data and cut it , Then reopen our registration edit table , Then re import the file we exported , Then reinitialize

good , Now let's start using the command prompt , To open the first cmd command , Then right-click the command prompt , Choose to run as Administrator

Need to go to bin Catalog :

5. install

          mysqld -install

 

 

6. initialization  

      mysqld --initialize-insecure --user=mysql  

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

7. start-up        

 

  net start mysql

 

8. Set the password    

  mysqladmin -u root -p password New password

 

9.Enter password: Old password  

  Directly enter , Because initialization directly puts mysql The password for is set to null

10. Connect          

mysql -u root -p 

 

 

11. test

Display database       show databases;

Display table           show tables;

 



Two 、 uninstall mysql

1 Out of Service      

      net stop mysql

2. Delete service    

  sc delete mysql       But the service is only disabled , Services still exist

3. Remove the service    

  mysqld remove         Need to go to bin Catalog , Could not find in the service mysql Yes

4. Delete registry information

  • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL
  • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL     
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL 

5. Delete mysql Installation directory

Open the registry
regedit

Open the service
services.msc


Be careful 1: Protected shutdown , In particular, self-protection should be turned off , Otherwise, you can't uninstall

Be careful 2: Permission problems


3、 ... and : solve mysql Unable to connect remotely :

1. stay mysql Enter... On the server mysql The command line

2. Execute the following statement : ( Note that the password needs to be modified according to your own configuration )


   mysql> grant all privileges on *.*  to  [email protected]'%' identified by '123456';
   mysql> flush privileges;


 


That's all for today's knowledge ~ ha-ha , I'll see you next time

Remember to smile today .

原网站

版权声明
本文为[Luoluo hushengwei]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206270327140806.html